Questions tagged [illegalmove]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
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 ...
0
votes
2answers
383 views

Check50, Game of Fifteen. Timed out while waiting for “Illegal move”

I've finished working on my pset3 game of fifteen. After consulting Check50, it keeps telling me that: timed out while waiting for "Illegal move." Can someone explain this to me? Don't know what to do....
0
votes
1answer
56 views

PSET3 'Illegal Move" coming up for legal moves as well! Almost done!

I have finished with Pset3 except for a tiny little bug. every move is somehow an Illegal Move. here's my code. bool move(int tile) { // TODO // find location of specified tile using linear search ...
0
votes
1answer
67 views

Pset3 Move Function “Illegal Move”

my code is notifying me with "Illegal Move" every time I test it. I was wondering if someone can help figure out what is wrong with my code? bool move(int tile) { // TODO int i, j; int swap; //rows ...
0
votes
1answer
35 views

Game of fifteen is is somewhat randomly printing extra lines of numbers and deeming moves illegal

Game of fifteen is 1) printing an extra line each time a move is labeled illegal and 2) somewhat randomly labeling moves illegal (e.g. it will swap to the left once but not twice, and up/down etc. ...
0
votes
1answer
95 views

Pset3 (Game of Fifteen): The tiles won't swap… (“Illegal move”)

I have an issue with my code in Game of Fifteen. I get "illegal move" when I try to swap the tiles, even if it's a "legal" tile. I tried everything but I really don't understand what's wrong. Does ...
1
vote
1answer
27 views

PSET 3 can't get move to swap tile above blank

Keep getting illegal move on following code and can't figure out why it won't swap. I am selecting the tile above the blank in testing. /** * Prints the board in its current state. */ void draw(...
0
votes
1answer
55 views

Pset3 Fifteen: “move” moves only once

My "move" function lets me make one move. After that, anything I do is illegal. This is my code: bool move(int tile) { int a = d - 1; int b = d - 1; for (int i = 0; i < d; i++) { for (int j ...
0
votes
1answer
30 views

Every move I do in CS50: pset3 is illegal…does anyone know why?

Hi please see code on this link: http://pastebin.com/wJy0PWZ7 Every move is illegal and I don't know why... Thanks
0
votes
1answer
120 views

PSET3 move() keeps showing “illegal move”

I am trying to make the moves happen. So far, the board shows correctly, with the 2 and 1 swapped if odd "d" is provided. But when I type any number at "Title to move:" it just keeps saying "Illegal ...
0
votes
1answer
114 views

Pset3 fifteen - move: Tiles wont switch, “illegal move” error even when valid

I have been trying to get the tiles of the move function to switch if any adjacent cells are blank. The initiation and draw functions work fine, I just need to get the move function to make the actual ...
0
votes
1answer
51 views

PSET 3 - Fifteen - Move Function Not Working - Brain melted and not sure how to proceed. Please help

so I've been stuck on this darn 'move' function for about a week now, and at this point I'm not sure how to move forward with things. At this point, whenever I make a move, I get "Illegal Move". ...
0
votes
2answers
588 views

pset3 fifteen.c Illegal move after almost solving it!

Question: What causes this error?! Terminal Output when running those 2 commands, Always stuck to almost solving them, then Illegal move ./fifteen 3 < ~cs50/pset3/3x3.txt ./fifteen 4 < ~cs50/...