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

Username:   Password: 
 RegisterRegister   
 Checkers!
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
jamesb




PostPosted: Thu May 29, 2003 1:05 pm   Post subject: Checkers!

OK. This is for a grade 10 OOT assessment. I decided to create checkers, and I need a way to move the pieces effectively. Should I use the mouse and have a drag and drop style? If so, how could I implement this?

Contact me if you want the program...or what I have of it so far.
Sponsor
Sponsor
Sponsor
sponsor
Homer_simpson




PostPosted: Thu May 29, 2003 1:28 pm   Post subject: (No subject)

what's checkers?!
void




PostPosted: Thu May 29, 2003 3:03 pm   Post subject: (No subject)

i say use mouse....and if the color of the square that you land on is the "playing" color..then allow the move....if not...reject it...you also need to restrict number of squares...and you need to erase peices that are killed...and eventually u need to program the crowning and the special moves available for that
Tony




PostPosted: Thu May 29, 2003 4:51 pm   Post subject: (No subject)

Use mouth to move pieces around (you can make the piece "attach" to the mouse to show the drag) then on release, lock it to the closest square which will be a 2D array.

Before moving the piece though, you need to validate the move from original spot to the one you just draged the piece to. If it's ok, change the values in the array.

As for erasing, you can just redraw your background + array. Since destoryed pieces will not be contained in the array, there's nothing special here.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Homer_simpson




PostPosted: Thu May 29, 2003 4:58 pm   Post subject: (No subject)

what's checkers?! =(
Tony




PostPosted: Thu May 29, 2003 5:02 pm   Post subject: (No subject)

its a board game. Played on the same board as chess, but only 1 color is used (back I think).

each player has 3 rows of units, which can only move 1 space diagnoly. If they are next to opponent's piece you can jump over it (providing there's an empty space to land), thus destorying opponent's piece (you can destroy more then one if your piece can continue jumping from the landing spot).

Game is won when all opponent's pieces are destoyed. When you get to opposite end of board, you get a special unit that doesn't have distance restrictions.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Andy




PostPosted: Thu May 29, 2003 7:52 pm   Post subject: (No subject)

checkers in grade 10? wow, i know some one who is in grade 11 comp sci, he's a math genius and he's making checkers for his final, yet he is struggling with it...
Catalyst




PostPosted: Thu May 29, 2003 8:00 pm   Post subject: (No subject)

checkers isnt that complicated
Sponsor
Sponsor
Sponsor
sponsor
Andy




PostPosted: Thu May 29, 2003 8:02 pm   Post subject: (No subject)

hey catalyst, lay off, not everyone is as smart as you, and if he's taking grade 10 compsci, that must tell u something...
Asok




PostPosted: Thu May 29, 2003 8:10 pm   Post subject: (No subject)

catalyst is in grade 10 comp sci too so watch yourself dodge.

although I do agree, not everyone is as smart as catalyst such as, well everyone. *bows*
void




PostPosted: Thu May 29, 2003 8:25 pm   Post subject: (No subject)

all hail catalyst programmer of stuff
Andy




PostPosted: Thu May 29, 2003 8:45 pm   Post subject: (No subject)

our friend catalyst at home
hollow be thy code
your scolorship come, your dreams be done
on earth as it is in ur world
give us today our daily source code
and forgive us who doubted your abilities just as we forgive us for doubting our abilities
lead us not into bad programming
but deliver us from less than 100%
urs truly
fellow programmer
Homer_simpson




PostPosted: Thu May 29, 2003 8:46 pm   Post subject: (No subject)

hehe good poem...
Catalyst




PostPosted: Thu May 29, 2003 8:48 pm   Post subject: (No subject)

ditto
JayLo




PostPosted: Thu May 29, 2003 8:51 pm   Post subject: (No subject)

hm... reminiscent of the Lord's Prayer.
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  [ 16 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: