Computer Science Canada CHECKER GAME HELP! PLEASE! |
Author: | d3c0d3d [ Mon Jan 12, 2004 7:23 pm ] |
Post subject: | CHECKER GAME HELP! PLEASE! |
CAN ANYONE SHOW ME HOW TO PUT THE PIECES FOR THIS GAME?...YOU CAN SHOW ME HOW TO DO ONE...AND ILL DO THE REST..PLEASE AND THANKS! ![]() |
Author: | d3c0d3d [ Mon Jan 12, 2004 7:24 pm ] |
Post subject: | |
here's how i started. var winID : int := Window.Open ("graphics:400;400 , title:Checker Board") %Checker Board_ for x : 1 .. 8 for y : 1 .. 8 drawfillbox (x * 50, y * 50 - 1, x * 50 - 50, y * 50 - 50, ((x+y*7) mod 2) * black) end for end for |
Author: | Cervantes [ Mon Jan 12, 2004 7:45 pm ] |
Post subject: | |
read up on the ever useful tool known as "arrays" |
Author: | DanShadow [ Mon Jan 12, 2004 7:46 pm ] | ||
Post subject: | |||
You might do it the slow, but accu rate way like this:
I coded a program, where you can lift and move checkers...ill upload the code if I remember, heh. I hope this helps. |
Author: | Andy [ Mon Jan 12, 2004 8:01 pm ] |
Post subject: | |
caps are lame |
Author: | McKenzie [ Mon Jan 12, 2004 8:26 pm ] | ||||
Post subject: | |||||
Dodge is right, nver type in ALL CAPS, it pisses people off. Thats not what you want when you're asking for help. Here we go anyways. 1. You want to use a 2-dim array to store the pieces
2. Recognize that you are using 2 different coordinate systems. The screen coordinates and the board coordinates. I would suggest making 2 simple procedures to convert back and forth. e.g.
3. Make a procedure to draw a piece given a boardx,boardy and a colour. |
Author: | shorthair [ Mon Jan 12, 2004 9:12 pm ] |
Post subject: | |
decode , to start if your not 2 sure ( im just guessing here ) how to use an array , then using a 2d array isnt where you should start , i mean sure you only asked us to get the peices on hte board , but to me thats the hardest part , the code for movent is easy , just some for loops and some if statements , read through the tutorials and you will find alot of learning help , you should learn how to use the arrays in many situations , dont just use the code but learn the code so you will remember what its used for, you probably have compsci exams coming up and knowing this can make things nice and easy when it comes to writing an exam, i just want to make sure your understanding the code , be sure to ask more detailed questions if you dont understang something. Shorthair ![]() ![]() |
Author: | DanShadow [ Tue Jan 13, 2004 8:53 am ] | ||
Post subject: | |||
Here is the code to move checkers:
Enjoy! ![]() |