Ok got another bug that doesn't make any sense to me...

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
junkbunny
Posts: 7
Joined: April 13th, 2013, 4:01 pm

Ok got another bug that doesn't make any sense to me...

Post by junkbunny » April 24th, 2013, 4:19 am

seriously idk wtf is with this one, im part way through working on the tic tac toe in lesson 12, and i draw the grid, set the square states, basically im up to the point where im about to start making the cursor move aaaaand i test it out and there are 2 Xes on the screen in position 0,1, and 2,1.. so im like wtf, i look for the problem cant figure it out. i run it again ( keep in mind i have done NOTHING to the code, now there are Xes, at 1,1 and 3,0. so i look around, again touch nothing, run it again and its like it was before. i could understand if i messed up an there was a glitch, but im not changing the code how in the hell is the position of the Xes changing???
Attachments
Chili DirectX Framework.rar
i had to delete the ipch in order to fit in in there, but that shouldn't make a difference
(5.79 MiB) Downloaded 146 times

junkbunny
Posts: 7
Joined: April 13th, 2013, 4:01 pm

Re: Ok got another bug that doesn't make any sense to me...

Post by junkbunny » April 24th, 2013, 4:37 am

ok, do i figures out the problem is with the beginning statement where im designating all the square states to empty. that would explain why the xes are changing position without me changing the code, its just garbage in the ram thats causing that. but i don't know what is wrong with the statement.

for (int index = 0; index < 9; index++)
{
SetSquareState(index, empty);
}

should that not designate all the set square states to empty? am i missing something here?

Musi
Posts: 106
Joined: November 25th, 2012, 1:06 am

Re: Ok got another bug that doesn't make any sense to me...

Post by Musi » April 24th, 2013, 5:36 am

Have a look in the SetSquareState function, read what each case in the switch statement does, i'm sure you'l see it :)
Musi

There are 10 types of people that understand binary.
Those that do, and those that don't.

junkbunny
Posts: 7
Joined: April 13th, 2013, 4:01 pm

Re: Ok got another bug that doesn't make any sense to me...

Post by junkbunny » April 24th, 2013, 12:52 pm

bahahaha omg im such a tool. i copied and pasted an changed all the cases, but not the actually states. im slowly getting better at this trouble shooting lol but ive only been at it a week an a half so it will probably take some time, i have no doubt i will be back here soon :P thanks so much foryour help

Post Reply