Questions tagged [game-of-fifteen]

Game of Fifteen, one of the assignments in Problem Set 3

Filter by
Sorted by
Tagged with
0
votes
2answers
851 views

Pset3 won-function works only with 3x3 board. Where am I wrong?

Pset3 won-function successfully passed this test ./fifteen 3 < ~cs50/pset3/3x3.txt only for a 3 × 3 board. For a 4x4 board the program's output is: 1 2 3 4 5 6 7 _ 9 10 12 ...
3
votes
3answers
416 views

Blank tile without using a variable

Regarding the blank tile in Game of Fifteen, can I avoid using a variable for the blank? In other words, can I just print an underscore when I reach zero in my array?
0
votes
3answers
452 views

Pset3 Fifteen Blank Space

How do I keep track of the blank space positions (i and j) without having to search for it again and again everytime. In the tips, the girl said maybe with a variable? Because my game is almost ...
1
vote
2answers
1k views

Pset3 Fifteen Move function

I dont even know how to begin the move function, can somebody give me some ideas please? Probably by searching the tiles position, but how can i do that?
0
votes
1answer
511 views

How to Print the Blank Tile in the Game of Fifteen

In Game of fifteen we are asked to print a blank space at the end of the game, they fistly tell us to put the last number as any Int, then they ask us to print something that is not the int we chose, ...

1 2 3 4
5