Computer Science Canada tic tac toe |
Author: | ohgeez_ [ Wed Apr 05, 2006 9:27 pm ] | ||
Post subject: | tic tac toe | ||
my first game =D. I didn't use x's and o's because i didn't want to waste time drawing them. Just finished a massive pixel graphic program for school. Please give comments on how to improve this.
|
Author: | TheOneTrueGod [ Wed Apr 05, 2006 9:38 pm ] | ||
Post subject: | |||
Nice work I remember there was some uber efficient way to code Tic Tac Toe in like < 50 lines. It might be in one of the stickies, I'll try and post a link in a bit. One thing I noticed is: You can place a red on top of a blue, and vice versa. That is to say, if I click on one location, then click on it again, the next piece will be placed there as well. If I do this a couple times, it even names a winner. Instead of using coding like: click delay action consider:
This makes it so no matter how long they hold the mouse down, there will be no negative reprocussions. Other than that, nice work. Definetly beats my first Tic Tac Toe game (By a long shot ) |
Author: | NikG [ Thu Apr 06, 2006 10:23 am ] | ||
Post subject: | |||
Quote: consider:
If button = 1 then loop mousewhere(x,y,button) exit when button = 0 end loop end if This makes it so no matter how long they hold the mouse down, there will be no negative reprocussions. Interesting suggestion, TheOneTrueGod, but I'm confused. You helped me fix that kind of a bug in a much better way for my City Defender. If you remember, you suggested a variable called OldButton, which should be set to button before each Mouse.Where and a check that OldButton is not equal Button.
This also prevents errors from users holding the mouse down for too long without the usage of an extra loop. Edit: oh yeah, great first game ohgeez_ |
Author: | Delos [ Thu Apr 06, 2006 10:55 am ] |
Post subject: | |
Why reinvent the wheel? Aside from the learning that you'll get it you do it well... Look up Mouse.Moved() and Mouse.ButtonWait()...they'll make your life a little easier, if not more variable.... Sorry, inside joke. |
Author: | djlenny_3000 [ Thu Apr 06, 2006 1:18 pm ] |
Post subject: | |
very nice game! in my opinion very well done try to make it so instead it draw an X trough the whole box or an O with a diameter of the box instead of circles but very nice start |
Author: | TheOneTrueGod [ Fri Apr 07, 2006 6:22 am ] | ||
Post subject: | |||
I don't know why, but I never got around to using the predefined turing functions. (Probably because my teacher hated them for no apparante reason) The reason I gave two different ways to do it was because each was circumstantial. In NikG's game, you wanted stuff to happen while the user was holding down the mouse click. The way I provided would allow the program to run while the user still held the mouse button down. In ohgeez_'s game, its much more plausible for the program to pause, and wait until the user stops pressing the button. It would be possible to do it the other way, but he would probably have to put in quite a few more checks scattered throughout the following lines:
|
Author: | Clayton [ Sat Apr 08, 2006 6:02 pm ] |
Post subject: | |
good game, as mentioned above you can draw over squares more than once, but other than that gj kinda off topic but dont you think we should make a sticky for tic-tac-toe games and pong and stuff like that (common games that everyone does) |
Author: | gogeunks1 [ Tue Jan 13, 2009 6:15 pm ] |
Post subject: | Re: tic tac toe |
i dont get the part about the procedure and the bule (1) := blue (1) + 1 |
Author: | gogeunks1 [ Tue Jan 13, 2009 6:15 pm ] |
Post subject: | Re: tic tac toe |
can someone explain it to me??? |
Author: | Parker [ Wed Jan 14, 2009 9:04 am ] |
Post subject: | RE:tic tac toe |
It works, so that automatically makes it good Some things you could improve on are : - Keep blue and reds score - Make X and O's because that what Tic Tac Toe is really about (lol) - Ask if they want to play again (goes with score^^) - You dont have to show the coordinates of the mouse on run screen. |
Author: | chrisbrown [ Wed Jan 14, 2009 9:49 am ] |
Post subject: | RE:tic tac toe |
Quote: It works, so that automatically makes it good Enjoy that fallacy while it lasts... |
Author: | Insectoid [ Wed Jan 14, 2009 1:28 pm ] |
Post subject: | RE:tic tac toe |
Parker, Windows 'works', but does that make it good? I'd say 85% at least of developers shun windows, the number is likely higher. Say 2 programs do exactly the same thing, written is the same language, but one runs 30% faster the other and takes only 80% the space. Which is better? In the real world, speed and efficiency (and sometimes clever marketing & contracts, in the case of one company I won't name but rhymes with licrohoft) are what own the industry. If the world was perfect (if only restaurants became famous for good quality food rather than giving toys to children, in the case of one company I won't name but rhymes with sick fondles). |
Author: | Parker [ Thu Jan 15, 2009 8:39 am ] |
Post subject: | RE:tic tac toe |
I am trying to be nice, although it may not be a top of the line tic tac toe it still works. Therefore I am trying to give them positive feedback along with constructive critiscm. PS: I like windows |