
-----------------------------------
JonnyBigBoi
Tue Jan 11, 2005 12:00 pm

Othello help
-----------------------------------
in my game othello im making for my computer class, i have the 4 peices to start in the middle of the board but if i click on the peices already colored they will change i was wondering how i could make it so the peices once they are on the board they cant be taken over

-----------------------------------
scottyrush13
Tue Jan 11, 2005 12:16 pm


-----------------------------------
tsk tsk jonny, you already made a topic called othello help

you do realise that making multiple unneccesary topics is frowned upon in this forum right?  :x 

....

just thought i'd get a word in before any of the mods  :lol:

-----------------------------------
Cervantes
Tue Jan 11, 2005 8:07 pm


-----------------------------------
tsk tsk jonny, you already made a topic called othello help

you do realise that making multiple unneccesary topics is frowned upon in this forum right?  :x 

....

just thought i'd get a word in before any of the mods  :lol:
You're absolutely right.  It's getting incredibly annoying to have to sift through a bunch of your threads to figure out which is the latest and where you need help.  Really, it's an awful lot of work, just to help you.

-----------------------------------
JonnyBigBoi
Thu Jan 13, 2005 12:13 pm


-----------------------------------
K, well i have figured out how that my topic goes to the top after i post a reply so hopefully the mods will forgive me and help me out...

OK, my question is how would i make my game so when i click on a spot that is already occupied the spot will not change color it will just stay the same and not change. thx.

-----------------------------------
Buen
Thu Jan 13, 2005 12:18 pm


-----------------------------------
K, well i have figured out how that my topic goes to the top after i post a reply so hopefully the mods will forgive me and help me out...

OK, my question is how would i make my game so when i click on a spot that is already occupied the spot will not change color it will just stay the same and not change. thx.

Keep track of what is colored in or not using an 2D array, it would mimic the actual grid and you can either use numbers lik 1 = Occupied and 0 = Empty or even a boolean type array (True and False, representing Occupied and Empty respectively.)

-----------------------------------
scottyrush13
Thu Jan 13, 2005 12:30 pm


-----------------------------------

JonnyBigBoi wrote: 
K, well i have figured out how that my topic goes to the top after i post a reply so hopefully the mods will forgive me and help me out... 

OK, my question is how would i make my game so when i click on a spot that is already occupied the spot will not change color it will just stay the same and not change. thx. 


Keep track of what is colored in or not using an 2D array, it would mimic the actual grid and you can either use numbers lik 1 = Occupied and 0 = Empty or even a boolean type array (True and False, representing Occupied and Empty respectively.)


nikk/buen...i beleive is right on this one, this is what i would try if i was in your situation, i think you could do a little readon up on the tutorials and then ask questions if you still dont understand...

just telling you to read the tutorials before the mods do  :D  :lol:

-----------------------------------
JonnyBigBoi
Thu Jan 13, 2005 12:31 pm


-----------------------------------
loop
    var turnCounter : int
    var grid : array 1 .. 8, 1 .. 8 of real
    turnCounter += 1
    if grid (8, 8 ) = 0 then
        grid (8, 8 ) := turnCounter mod 1
    end if
end loop

this is what i have as of now 15 mintues before then end of class :) it does not seem to work its probably completly wrong.

-----------------------------------
Buen
Thu Jan 13, 2005 12:35 pm


-----------------------------------
loop
    var turnCounter : int
    var grid : array 1 .. 8, 1 .. 8 of real
    turnCounter += 1
    if grid (8, 8 ) = 0 then
        grid (8, 8 ) := turnCounter mod 1
    end if
end loop

this is what i have as of now 15 mintues before then end of class :) it does not seem to work its probably completly wrong.

Please "code" your code for it looks a little easier to read and we know what is what. Just getting a word in before the mods do  :D  Though using just single numbers might be cleaner than real numbers  :wink:

-----------------------------------
scottyrush13
Thu Jan 13, 2005 12:38 pm


-----------------------------------
Please "code" your code for it looks a little easier to read and we know what is what

jonny, nikk is right again, it gets confusing for the people tryin to help you when we have to try and figure out where your code starts and where it ends.

-----------------------------------
scottyrush13
Thu Jan 13, 2005 12:44 pm


-----------------------------------
jonny please dont try to deceive the mods by editing afterwards, even though we appreciate the afterthought the damage has been done already, we thank you anyways.  and i would appreciate it jonny if you would not be disrespectful towards cervantes, he is the only one who is willing to help me and the only reason you arent being helped is because you wont follow the rules of the forum

-----------------------------------
scottyrush13
Thu Jan 13, 2005 12:47 pm


-----------------------------------
now i think its best that we discontinue spamming this topic and you start following the  rules of the forum, but please do not spam this by asking questions that can be answered by reading around the site, unless you read around and honestly are still confused

NO MORE SPAMMING OF THIS TOPIC!

-----------------------------------
Buen
Thu Jan 13, 2005 4:11 pm


-----------------------------------


NO MORE SPAMMING OF THIS TOPIC!

You the one who posted the last 3 times in a row  :?

-----------------------------------
Cervantes
Thu Jan 13, 2005 4:33 pm


-----------------------------------
jonny please dont try to deceive the mods by editing afterwards, even though we appreciate the afterthought the damage has been done already, we thank you anyways.  
Deceive the mods?  Well, I don't know what was there, but, if he's deceiving the mods, he's deceiving everyone.  Anyways...

and i would appreciate it jonny if you would not be disrespectful towards cervantes, he is the only one who is willing to help me

Maybe I missed it, but I don't remember him being disrespectful to me.  Just making a ton of different threads that aggrivated me.

the only reason you arent being helped is because you wont follow the rules of the forum

Yeah, so many threads is annoying.  I hope you've learned how the boards function, Jonny, and will from now on keep all your related questions in the same thread.

Lastly,


loop
    var turnCounter : int
    var grid : array 1 .. 8, 1 .. 8 of real
    turnCounter += 1
    if grid (8, 8 ) = 0 then
        grid (8, 8 ) := turnCounter mod 1
    end if
end loop


Don't declare variables inside the loop.  Turing will allow you to, but it's best not to.  Besides, in this case, assigning them inside the loop doesn't even save you any lines.
And, you've got it right.  The only thing you have to do is change grid (8,8 ) to grid (x,y) where x and y are numbers from 1 to 8 that are determined based on the location and characteristics of the grid, and the location of the mouse. 
-Cervantes

-----------------------------------
JonnyBigBoi
Thu Jan 13, 2005 6:42 pm


-----------------------------------
k thx alot for the answer and ill be sure to only use one thread for the same questions. 
k, how would i limit the spots that can be taken to just the open spaces around the ones already taken. here is what i have

-----------------------------------
scottyrush13
Thu Jan 13, 2005 8:02 pm


-----------------------------------
cervantes he didnt say anything on the forum...said it in class (hes in my class, along with buen)

but im pretty sure he was joking...WERENT YOU JONNY?  :x

-----------------------------------
AsianSensation
Thu Jan 13, 2005 8:12 pm


-----------------------------------
quit spamming, warning counted.

-----------------------------------
JonnyBigBoi
Fri Jan 14, 2005 12:33 pm


-----------------------------------
var turnCounter : int
var grid : array 1 .. 8, 1 .. 8 of real
var x, y : int

loop
    turnCounter += 1
    if grid (x, y) = 0 then
        grid (x, y) := turnCounter mod 1
    end if
end loop

this does not seem to work its suposed to make it so i cant place a peice over the peice that is already there, but it still does if anyone could help id love it.

-----------------------------------
Andy
Fri Jan 14, 2005 3:48 pm


-----------------------------------
heh othello.. nice game, [url=http://compsci.ca/v2/viewtopic.php?p=10109] i i made that a while back  the source is attatched

-----------------------------------
Cervantes
Fri Jan 14, 2005 4:23 pm


-----------------------------------
var turnCounter : int
var grid : array 1 .. 8, 1 .. 8 of real
var x, y : int

loop
    turnCounter += 1
    if grid (x, y) = 0 then
        grid (x, y) := turnCounter mod 1
    end if
end loop

this does not seem to work its suposed to make it so i cant place a peice over the peice that is already there, but it still does if anyone could help id love it.
It should work correctly, provided the rest of your program is correct.  Have you assigned every element of the array to equal zero, just after you declare the array, near the top of your program?

-----------------------------------
JonnyBigBoi
Sat Jan 22, 2005 7:07 pm


-----------------------------------
no how would i do that?

-----------------------------------
Cervantes
Sat Jan 22, 2005 7:12 pm


-----------------------------------

for x : 1 .. 8
for y : 1 .. 8
  grid (x,y) := 0
end for
end for


-----------------------------------
JonnyBigBoi
Mon Jan 24, 2005 12:22 pm


-----------------------------------
what else would i need to have in order to make them work properly
