Questions tagged [fifteen.c]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
72 views

pset3 fifteen.c not working with check50: “expected exit code 0, not 1”

So my fifteen.c code compiles just fine and runs the .txt files with no issue. The code returns a "ftw!" and exit code 0 when executing the program with those .txt files. The issue is when I run the ...
0
votes
1answer
49 views

PSET3: Every move is ilegal, no matter what

I'm currently working on the move function that's in the game of fifteen and every single move is illegal even though my logic seems correct (at least to me), but it keeps outputting illegal move and ...
2
votes
1answer
260 views

pset3 fifteen.c passes local tests but fails check50 with timeouts

My fifteen.c passes the following local tests by getting to "ftw!" in each case: ~/workspace/pset3/fifteen/ $ ./fifteen 3 < ~cs50/pset3/3x3.txt ~/workspace/pset3/fifteen/ $ ./fifteen 4 < ~cs50/...
0
votes
0answers
24 views

ps3 fifteen move and won : error : control may reach end of non-void function [-Werror,-Wreturn-type] }

Im so close to finish fifteen. I have a mistake about syntax with the last } for my function Move() and Won(). Here the error message when I compile : fifteen.c:279:1: error: control may reach end of ...
0
votes
1answer
89 views

Move (fifteen )

Can anyone help me point out the mistake I've made? The underscore just moved so wrong that I can't find the pattern.
-1
votes
1answer
12 views

Fifteen.c <file error>

Can anyone tell me what have I done on the file? Where do all my codes goes?
0
votes
1answer
105 views

pset3 fifteen check50 correct / not correct

Hiyas! So I'm fairly confident that I've implemented a functional version of The Game of Fifteen, but the check50 sequence returns some odd errors: ~/workspace/pset3/fifteen/ $ check50 2015.fall....
0
votes
1answer
91 views

Help with fifteen.c move function

I hope all is well. I am blocked on the game of Fifteen section of Pset 3. I am taking this one function at a time and I am on the move function. I am able to find the tile that the user would ...
0
votes
1answer
68 views

fifteen move issue

Can anyone see the issue here? It moves "5" from the start position ok, but when it comes to "1" it is just two blank tiles in adjacent squares ("1" disappears). Obviously there is some issue with the ...
0
votes
1answer
19 views

Why does the variables passed on as arguments don't maintain their modified values?

Currently I am on 'Game of Fifteen' part of pset3, and I am having problem with my implementation of the function move. The function move calls a function legalMove which in turn calls another ...
0
votes
1answer
156 views

Pset 3, Move, What am I doing wrong?

Please give me some suggestions, I think I'm reasonably close: bool move(int tile) { int temp; int didSwap; int blankRow; int blankCol; // search for blank tile for(int row =...
1
vote
0answers
113 views

Fifteen.c -> expected file to be of length X “cheap solution”?

I've been having some trouble with the fifteen game code. Even though it works as expected, when I do check50, I get a bunch of errors related to the expected size of the log file. After looking at ...
1
vote
1answer
141 views

Inint funtion in fifteen.c working but check50 is unhappy

My fifteen.c is working properly but check50 says it's not initialising right... It says: :( init initializes 3x3 board correctly \ expected file to be of length 18, not 19 :( init initializes 4x4 ...
0
votes
1answer
168 views

pset3 fifteen - how to check if tile is adjacent to 0/“_”?

I have tried to do this, but it has only resulted in a segmentation fault.
0
votes
1answer
187 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 ...
0
votes
1answer
50 views

What's wrong with my pset 3 fifteen.c code?e

having some trouble with pset3 fifteen.c. Not sure what is wrong. Watched the walkthrough. After the greeting message, nothing appears. Here is pastebin: http://pastebin.com/Vd48ENBc Here is ...
0
votes
1answer
1k views

in pset3,fifteen.c

When the won function is working. check50 gives the following result: And after intentionally making the won function wrong ,the result through check50 is: Now,it's obvious that to win the game ,...