The goal of this assignment is to implement GameOfFifteen

Related tags

App GameOfFifteen
Overview

Game of Fifteen

Demo

Everything Is AWESOME

The board for the game of Fifteen is filled randomly with numbers from 1 to 15 and one empty space. You can move the neighboring value to the empty space. The goal is to get the sorted sequence from 1 to 15.

You can check the Game of Fifteen online here. Note that in the implementation for this assignment, the values are moved by arrows rather than mouse clicks.

  • Game of Fifteen is solvable only if the initial permutation of numbers is even. First, implement the function isEven declared in GameOfFifteenHelper.kt
    checking whether a permutation is even or odd. Source: GameOfFifteenHelper.kt
    ; tests: TestGameOfFifteenHelper.kt
    .

You can use the following algorithm to check the given permutation. Let P is a permutation function on a range of numbers 1..n. For a pair (i, j) of elements such that i < j , if P(i) > P(j), then the permutation is said to invert the order of (i, j). The number of such inverted pairs is the parity of the permutation. If permutation inverts even number of such pairs, it is an even permutation; else it is an odd permutation.

  • Use the isEven function to produce only solvable permutations as initial permutations. Source: GameOfFifteenInitializer.kt
    ; tests: TestGameOfFifteenInitializer.kt.

  • Implement the GameOfFifteen class from scratch describing the game process. It should implement the Game interface and make use of initializer argument. Note that this argument is used in tests to provide a different initial permutation. Source: GameOfFifteen.kt;
    tests: TestGameOfFifteen.kt.

You might also like...
Maxibon kata for Kotlin Developers. The main goal is to practice property based testing.
Maxibon kata for Kotlin Developers. The main goal is to practice property based testing.

Kata Maxibon for Kotlin. We are here to practice property based testing. We are going to use KotlinTest to write our tests. We are going to practice p

KataContacts written in Kotlin. The main goal is to practice Clean Architecture Development

KataContacts written in Kotlin We are here to practice Clean Architecture Development. Clean Architecture is a way of structuring code. We are going t

TODO API Client Kata for Kotlin Developers. The main goal is to practice integration testing using MockWebServer
TODO API Client Kata for Kotlin Developers. The main goal is to practice integration testing using MockWebServer

KataTODOApiClient for Kotlin We are here to practice integration testsing using HTTP stubbing. We are going to use MockWebServer to simulate a HTTP se

Screenshot Kata for Android Developers with Kotlin. The main goal is to practice UI Screenshot Testing.
Screenshot Kata for Android Developers with Kotlin. The main goal is to practice UI Screenshot Testing.

KataScreenshot in Kotlin We are here to practice UI testing using screenshot tests for Android. We are going to use Espresso to interact with the Appl

Super Heroes Kata for Android Developers in Kotlin. The main goal is to practice UI Testing.
Super Heroes Kata for Android Developers in Kotlin. The main goal is to practice UI Testing.

KataSuperHeroes in Kotlin We are here to practice UI Testing. We are going to use Espresso to interact with the Application UI. We are going to use Ko

A reliable android app that shows upcoming fixtures, updated league tables, and top goal scorers in a Premier League and French Ligue 1
A reliable android app that shows upcoming fixtures, updated league tables, and top goal scorers in a Premier League and French Ligue 1

RapidScore Screenshots Table of Contents Description Dependencies API Reference Lessons Learnt Contributing Roadmap Google Playstore License Author In

Proyect with the goal to show my skills in android
Proyect with the goal to show my skills in android

ChipperMovie Es una aplicación de peliculas y sus detalles filtrados por categorias para demostrar el uso de mis habilidaedes en desarrollo movil. Ace

GOD - Goal of the day is the notes app which tracks your daily tasks, most important tasks & monthly goals
GOD - Goal of the day is the notes app which tracks your daily tasks, most important tasks & monthly goals

GOD - Goal of the day GOD - Goals of the day Problem Statement: People always face problems in finding their goals and keeping track over a period. Th

Owner
Josue Lubaki
"Have no limit, the courage to go beyond your own limits" -- Bruce Lee --
Josue Lubaki
An assignment app for Caper AI

JungsooAppCaperAI This is an assignment app for Caper AI. This app shows a list of products locally saved in room database to a user. User can tap on

Shahrukh Malik 0 Oct 15, 2021
code for the Mobiquity QA challenge assignment

MOBIQUITY QA CODE CHALLENGE This repository contains the code for Mobiquity code assignment for the Senior QA engineer position. Tech Stack the tools

ricardo larrahondo 1 Jan 3, 2022
This assignment has been given to me for Android developer position at SonyLiv.

asssignmentSonyLiv This assignment has been given to me for Android developer position at SonyLiv. This codeis not full functional but can give a cont

Rudra Chouhan 0 Nov 21, 2021
payhere online assignment

가계부 API 설명 실행 모든 컨테이너 실행 docker-compose up docker-compose up - d // 백그라운드 실행 데이터베이스만 실행 docker-compose up database docker-compose up -d database // 백그

Jerry 0 Jan 5, 2022
A Prework Assignment COdepath for Android

PreWork_SimpleTodo_Android This is a Prework Assignment Codepath Project 1 - Sim

Laxman Reddy Aileni 0 Dec 19, 2021
Android Camper parking app written in kotlin for assignment 2 of Mobile App Development

Technical Report Splash view Application shows a splash screen when opened. The

Alvaro Sanchez Domingo 1 Sep 9, 2022
SimpleToDo - Simple "To-Do" App for CodePath Prework Assignment

Project 1 - Simple ToDo App Simple ToDo is an android app that allows building a todo list and basic todo items management functionality including add

null 0 Dec 31, 2021
Kurly-assignment - Search GitHub Repository App For Android

Search GitHub Repository App Outline Github 내의 수많은 리포지토리를 키워드를 통해 검색할 수 있습니다. Ho

Minjeong Kim 0 Jan 5, 2022
ABSA Android Take Home Assignment

ABSA Android Take Home Assignment Writing the Make Up App challenge using Android Architecture Components, in 100% Kotlin :kotlin: Requirements Create

David Ndekere 0 Mar 18, 2022
Mobile Course Assignment 5

Assignment5 Mobile Course Assignment 5 Widgets that I Use TextView Button Circular Image View Libraries that I use Jetpack Navigation Circular ImageVi

null 1 Mar 31, 2022