Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Othello help
Index -> Programming, Turing -> Turing Help
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
JonnyBigBoi




PostPosted: Tue Jan 11, 2005 12:00 pm   Post subject: 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
Sponsor
Sponsor
Sponsor
sponsor
scottyrush13




PostPosted: Tue Jan 11, 2005 12:16 pm   Post subject: (No subject)

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? Mad

....

just thought i'd get a word in before any of the mods Laughing
Cervantes




PostPosted: Tue Jan 11, 2005 8:07 pm   Post subject: (No subject)

scottyrush13 wrote:
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? Mad

....

just thought i'd get a word in before any of the mods Laughing

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




PostPosted: Thu Jan 13, 2005 12:13 pm   Post subject: (No subject)

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




PostPosted: Thu Jan 13, 2005 12:18 pm   Post subject: (No subject)

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.)
scottyrush13




PostPosted: Thu Jan 13, 2005 12:30 pm   Post subject: (No subject)

Quote:

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 Very Happy Laughing
JonnyBigBoi




PostPosted: Thu Jan 13, 2005 12:31 pm   Post subject: (No subject)

code:
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 Smile it does not seem to work its probably completly wrong.
Buen




PostPosted: Thu Jan 13, 2005 12:35 pm   Post subject: (No subject)

JonnyBigBoi wrote:
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 Smile 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 Very Happy Though using just single numbers might be cleaner than real numbers Wink
Sponsor
Sponsor
Sponsor
sponsor
scottyrush13




PostPosted: Thu Jan 13, 2005 12:38 pm   Post subject: (No subject)

Quote:
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




PostPosted: Thu Jan 13, 2005 12:44 pm   Post subject: (No subject)

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




PostPosted: Thu Jan 13, 2005 12:47 pm   Post subject: (No subject)

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




PostPosted: Thu Jan 13, 2005 4:11 pm   Post subject: (No subject)

scottyrush13 wrote:


NO MORE SPAMMING OF THIS TOPIC!


You the one who posted the last 3 times in a row Confused
Cervantes




PostPosted: Thu Jan 13, 2005 4:33 pm   Post subject: (No subject)

scottyrush13 wrote:
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...
scottyrush13 wrote:

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.
scottyrush13 wrote:

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,
JonnyBigBoi wrote:

code:

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




PostPosted: Thu Jan 13, 2005 6:42 pm   Post subject: (No subject)

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



OthelloWhite.bmp
 Description:
the white piece
 Filesize:  7.82 KB
 Viewed:  3327 Time(s)

OthelloWhite.bmp



OthelloBlue.bmp
 Description:
the blue piece
 Filesize:  7.82 KB
 Viewed:  3326 Time(s)

OthelloBlue.bmp



Othello.t
 Description:
main file

Download
 Filename:  Othello.t
 Filesize:  4.25 KB
 Downloaded:  170 Time(s)

scottyrush13




PostPosted: Thu Jan 13, 2005 8:02 pm   Post subject: (No subject)

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? Mad
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 2  [ 22 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: