Share My Creation number sliding game

Hi,

this is my first attempt to create an app using B4A and I would appreciate any comments/suggestions.

My app is actually a game and I call it "9Buttons" - the game is about sliding numbers to sort them.

All you have to do is enter the amount of numbers that you want to sort and you will be presented a grid...

The only device I have to test on is a Samsung Galaxy S3..so if you have a device where my app doesnt look OK - please let me know.

But I am also interested in suggestions about how to improve the game itself..GUI..colors..etc.

I'm am not sure how to provide the app..to install it on my device I download it as an .apk file from my website and install it..

So here is the download link for the .apk file (maybe you have to allow "unknown apps" in the security settings)

http://www.scout-soft.com/spiel.apk

So..please let me know what you think about my app

thanks

Heinz
 

Attachments

  • thegame.PNG
    thegame.PNG
    37.2 KB · Views: 4,800
  • selectsize.PNG
    selectsize.PNG
    38.3 KB · Views: 286
  • selectlanguage.PNG
    selectlanguage.PNG
    93.2 KB · Views: 291
Last edited:

sorex

Expert
Licensed User
Longtime User
Howdy,

I only had 1 play but it seems that I got an unsolvable one (3x3).

Did you just randomize the array? if so, that can cause the creation of unsolvable puzzles.

it looked fine on my 1024x800, will have a test on my small res phone aswell.
 

Spacewalker

Member
Licensed User
Longtime User
sorex;138130 Did you just randomize the array? if so said:
thank you for yor answer.

Yes..the array is random...so the creation of an unsolvable puzzle would be possible theoretically...however...I don't the mathematical background to be honest...maybe there is always a solution of a 3x3 array ...?

Heinz
 

sorex

Expert
Licensed User
Longtime User
Tried it on my phone aswell. looks fine on portrait.

when I rotate the screen it only shows half of it (menu) so I can't press the start button :)

I you want to have a try... my current puzzle that appears unsolvable (to me based on the 2 lowest layers only) is

1 2 3
4 5 6
8 7

I wrote simular puzzle last week but with an image so I'm used to solve 'm fast (unlike this combination)
 
Last edited:

sorex

Expert
Licensed User
Longtime User
check here http://heuristicswiki.wikispaces.com/N+-+Puzzle

Solvability: Half of the initial states for the N-Puzzle are impossible to resolve. This can be proved by an invariant of the board: The parity of permutations of all squares + the parity of the Manhattan distance of all squares. This is an invariant because each legal move changes both the parity of the permutation and the parity of the Manhattan distance. This invariant split the space of all possible states into two equivalence classes of solvable and unsolvable states.
 

Spacewalker

Member
Licensed User
Longtime User
thank you for that link - very interesting.

So if 50% of a 3x3 puzzle can not be solved...how could I avoid to offer them? I'd need a way to find out if a puzzle can be solved or not and only offer puzzle that can be solved...

well...I have an idea how I can assure that a puzzle can be solved.
I dont use a radom sequence of numbers but I do this:

I start with the solved game and programmatically do some valid moves
1 2 3
4 5 6
7 8

So lets say I did 30 moves programmatically..what ever result I have - this can be solved
I just have to make sure that I always get different puzzles as a result...so there must be a "random" factor for the moves that I do programmatically...


Heinz
 
Last edited:

sorex

Expert
Licensed User
Longtime User
The way to do it is to simulate physical movements (well that's how I did it).

Then you are sure you follow the rules of the game and don't have wrong playfields.

Don't fear slowness of your app compared to the array randomizer.

I did level*250 moves and on a 12x12 (that's 1000 or 1250 moves) it's still miliseconds to scramble it,
just don't update the playfield during the scramble as that might make it slow.
 
Last edited:

sorex

Expert
Licensed User
Longtime User
it's not uploaded anywhere since it's just a test case.

I've attached it tho
 

Attachments

  • SlidingPuzzle.apk
    257.4 KB · Views: 265

nypaulie

Active Member
Licensed User
Longtime User
Great!

When I was a kid I played with a metal (there was NO plastic then!) toy called a "15 Puzzle". You could develop a skill with How you moved the numbers so it would require the least number of moves. You have captured this beautifully with your scoring section. Congratulations!
 
Last edited:

sorex

Expert
Licensed User
Longtime User
well, like I said it was just a testcase to see how something like that would be constructed on android/b4a. It was not intended to be release, but it should be no problem to select another picture.
 
Top