Beginner Lesson 12 : Placing X bug

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
rhn94
Posts: 5
Joined: July 20th, 2012, 6:22 pm

Beginner Lesson 12 : Placing X bug

Post by rhn94 » August 1st, 2012, 3:22 pm

So i am almost halfway through the lesson and am at the part(1:19:46) where chili writes this piece of code to put down X in the grid

Code: Select all

if (kbd.EnterIsPressed() )
{
     SetSquareState( cursorX, cursorY, X);
}
For some reason when i run the program after this and press enter to place a X, it does not appear and after i move the cursor the X appears at that coordinate to where i moved it to. And the first 2 rows can't be filled with Xs. Can someone please help?

i have attached my code.
Attachments
TicTacToe-rhn.zip
(35.63 KiB) Downloaded 150 times

User avatar
XxWalKaxX
Posts: 244
Joined: June 11th, 2012, 7:15 pm

Re: Beginner Lesson 12 : Placing X bug

Post by XxWalKaxX » August 1st, 2012, 3:37 pm

in your compose frame you had the following

Code: Select all

if( kbd.DownIsPressed() )
	{
		SetSquareState(cursorX,cursorY,X );
	}
You should change it EnterIsPressed() )
What you call a bug...I call a new feature!

rhn94
Posts: 5
Joined: July 20th, 2012, 6:22 pm

Re: Beginner Lesson 12 : Placing X bug

Post by rhn94 » August 1st, 2012, 3:45 pm

Derp. Thanks

User avatar
Asimov
Posts: 814
Joined: May 19th, 2012, 11:38 pm

Re: Beginner Lesson 12 : Placing X bug

Post by Asimov » August 2nd, 2012, 4:03 am

Hi,

There should be a disclaimer at the end of the video.

"Everything in the tutorial works, so if it doesn't you have typed it wrong" LOL

Asimov
----> Asimov
"You know no matter how much I think I have learnt. I always end up hitting brick walls"
http://www.asimoventerprises.co.uk

User avatar
XxWalKaxX
Posts: 244
Joined: June 11th, 2012, 7:15 pm

Re: Beginner Lesson 12 : Placing X bug

Post by XxWalKaxX » August 4th, 2012, 6:56 am

well i dont know bout everybody else but i make mistakes like that all the time, but in programmin, a simple mistake is catastrophic haha
What you call a bug...I call a new feature!

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Beginner Lesson 12 : Placing X bug

Post by chili » August 4th, 2012, 10:04 am

Mistakes are inevitable. The only thing that tweaks my neuticles is when they say "I did everthing exactly like chili and it doesn't work". FORK! IN THE EYE! :lol:
Chili

EdadTace
Posts: 32
Joined: April 22nd, 2012, 10:28 am

Re: Beginner Lesson 12 : Placing X bug

Post by EdadTace » August 4th, 2012, 11:37 am

the other day i posted a problem I had with some code from a book - it was written exactly like in the book - exactly - but it wouldn't compile and I just couldn't figure it out

after getting an answer and then finally getting further into the book i then realize it wasn't suppose to be compiled yet lol

Post Reply