Questions tagged [game-of-fifteen]

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

Filter by
Sorted by
Tagged with
3 votes
2 answers
37k views

How to solve "control may reach end of non void function" error

When I try to compile my code, I get an error message that says "control may reach end of non void function." What does this message mean and how can I avoid this error? Here is the function that's ...
nivedita shrivastava's user avatar
2 votes
2 answers
41k views

How do I fix a "use of undeclared identifier" compilation error?

In the following code snippet: for (int column = 0; column < d - 1; column++); { board[&row][&column] == counter; counter++; make returns the following error: fifteen.c:140:19: ...
xkalibur's user avatar
1 vote
2 answers
185 views

PSET3 : fifteen: how to identify board edges in move function?

Hi I am working on pset3 : fifteen and trying to implement move function. I'm not quite sure how to identify board edges and deal with this. My swap is also not working as the tile I want to move ...
i'i'i'i'i'i'i'i'i'i's user avatar
0 votes
1 answer
64 views

Why isn't this move function from Game of Fifteen working?

bool move(int tile) { for(int row=0;row<d;row++) { for(col=0;col<d;col++) { if(board[row][col]==tile) { if(board[row+1][col]==0 || board[row-1][col]==0 ||...
Vaish MK's user avatar
  • 167
1 vote
1 answer
673 views

expected an exit code of 0, not a prompt for input WON

I'm still stuggling with the game of fifteen, and I could make it works. However, when I run check50 it displays :( 3x3.txt wins the 3x3 board \ expected an exit code of 0, not a prompt for input :...
Maggie's user avatar
  • 14
0 votes
1 answer
470 views

pset 3 "control may reach the end of a non-void function" [duplicate]

I know what this error means, but how do I fix it? I'm using a if... else... function, so I'm not sure how to improve upon that. Thanks!
Yao Li's user avatar
  • 33
0 votes
2 answers
512 views

How to pass grid values to draw in pset3

I've just finished coding init and have started draw but I'm not sure how to pass on my grid values to the draw functions. Especially as the values may change as the user plays the game. I've tried to ...
Yao Li's user avatar
  • 33
0 votes
1 answer
591 views

Pset 3 - Check 50 error for fifteen

The code for pset 3 fiftenn is running fine when i enter different values of d and is getting completed as well. But on check 50 getting the following set of errors. Any help here would be ...
Hardik Rathod's user avatar
0 votes
1 answer
63 views

PSET3 Game Of Fifteen tiles not swapping! (no illegal function but no change in board)

My game of fifteen is somehow still not working. here is the code for move() bool move(int tile) { // TODO // find location of specified tile using linear search //find tile location in nice ...
Ubuntu NutCracker's user avatar
0 votes
1 answer
190 views

PSET3 fifteen - part of move is not working and 1 and 2 switch

close to finishing pset3 fifteen.c. When I am playing with fifteen, everything is working except for when I attempt to switch "" with 8. There ends up being 2 ""s. I think that it might be something ...
Russell C.'s user avatar
0 votes
2 answers
533 views

pset3 fifteen move creates double numbers

So my move function finally compiles, but when I run the program and chose a legal tile (i.e. one by the blank) the blank turns into the tile I picked. So from this: 8 7 6 5 4 3 2 1 ...
Sofia's user avatar
  • 25