Author |
Message |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Thu Aug 28, 2003 2:43 pm Post subject: tic tac toe |
|
|
this is one of my very first Visual Basic programs. It sucks since I didn't know VB all that well back then. Since then I've made some better versions of the game (once compsci grade below me got it as their final project assignment... *sigh*)
Description: |
|
![](http://compsci.ca/v3/pafiledb/images/icons/clip.gif) Download |
Filename: |
tic_tac_toe.zip |
Filesize: |
10.46 KB |
Downloaded: |
1054 Time(s) |
|
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
the_short1
|
Posted: Sun Mar 28, 2004 5:17 pm Post subject: (No subject) |
|
|
bsic yet effective tic tac tow...... yes u must have been a real noob hen u made this,.., im sure u could do a lot better..... anyways... for its size(10 KB) that is AMAZING!!! i love VB because u can compile ur pictures into the program and stuff... tahts COOl!!!!! now i want to learn VB too... dam... so much do to over summer...
|
|
|
|
|
![](images/spacer.gif) |
Pat
|
Posted: Thu Apr 06, 2006 10:14 am Post subject: (No subject) |
|
|
This was fun. The X's and O's are kind of skinny, and a little hard to see. Maybe colour and a bold font would help? I'm new to visual basic, so I don't know how to change the program yet. But good job!
|
|
|
|
|
![](images/spacer.gif) |
Andy
|
Posted: Thu Apr 06, 2006 12:01 pm Post subject: (No subject) |
|
|
why do people not read the rules? when you reply to a topic that is almost three years old, that's called necroposting, and is against compsci.ca's policy...
|
|
|
|
|
![](images/spacer.gif) |
tifg
|
Posted: Thu Dec 21, 2006 2:18 pm Post subject: (No subject) |
|
|
posting now wouldn't be more than 3 yrs old.. so here goes
how did u get the variables to remember its values across cmd boxes?
ie.
>>>>in the "new game" cmd box
turn = "p1"
>>>>in another cmd box tahts sopposed to display either X or O depending on the player order
if turn = "p1" then
cmd1.caption = "X"
else
cmd1.caption = "O"
end if
the trouble for me now is taht the turn variable gets cleared across the cmd boxes... so it would go to the else statement everytime...
idont kno if this matters anything but i changed the "private sub to public sub nd it didnt do netin...
|
|
|
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Thu Dec 21, 2006 2:22 pm Post subject: (No subject) |
|
|
make sure your variables have the correct scope. Those decleared inside one function or subroutine will not be visible from another. You'd need something more... global.
|
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
tifg
|
Posted: Thu Dec 21, 2006 2:36 pm Post subject: (No subject) |
|
|
Tony wrote: make sure your variables have the correct scope. Those decleared inside one function or subroutine will not be visible from another. You'd need something more... global.
lol.. what EXACTLY do you mean by global? im listening
|
|
|
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Thu Dec 21, 2006 4:26 pm Post subject: (No subject) |
|
|
I mean that something like player turn should be accessable by every function, so you would want to declear that at the very top of your source file, outside of any particular sub.
|
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
cool dude
![](http://www.taylorstrategicmarketing.com/images/king.jpg)
|
Posted: Thu Dec 21, 2006 4:36 pm Post subject: (No subject) |
|
|
or off course make a module
|
|
|
|
|
![](images/spacer.gif) |
tifg
|
Posted: Thu Dec 21, 2006 7:22 pm Post subject: (No subject) |
|
|
alright... this wut i got so far, been workin on it for abt 40 mins... a TON of copy nd pasting..
but theres a couple major problems tho i don kno hwo to fix...
its very easy to find the problem so ill jux post this thing nd see if you guys can help me out...
Description: |
|
![](http://compsci.ca/v3/pafiledb/images/icons/clip.gif) Download |
Filename: |
tic tac toe.frm |
Filesize: |
10.28 KB |
Downloaded: |
475 Time(s) |
|
|
|
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Thu Dec 21, 2006 8:12 pm Post subject: (No subject) |
|
|
well don't look at me, I haven't been coding VB since... *looks at his original post* 2003 it appears. Heck, I don't even have Windows anymore, score!
|
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
cool dude
![](http://www.taylorstrategicmarketing.com/images/king.jpg)
|
Posted: Thu Dec 21, 2006 8:18 pm Post subject: (No subject) |
|
|
copy and paste is bad because you won't understand a lot of the code your writing. anyhow u have quite a bit of problems starting with u can double click on the same button and it will switch from X to O. to fix this you can disable the button. but i'll make your life much much easier by telling you to use control arrays. basically make one button name it something than copy and paste all your other buttons. this will be much easier and a lot more efficient. if you don't take my advice and continue your going to get really screwed up and it will take you hundreds of lines of code to make when you can make it under 50 lines
|
|
|
|
|
![](images/spacer.gif) |
cool dude
![](http://www.taylorstrategicmarketing.com/images/king.jpg)
|
Posted: Thu Dec 21, 2006 8:44 pm Post subject: (No subject) |
|
|
Here i started you off on the control array.
Description: |
|
![](http://compsci.ca/v3/pafiledb/images/icons/clip.gif) Download |
Filename: |
tictactoe.frm |
Filesize: |
3.17 KB |
Downloaded: |
489 Time(s) |
|
|
|
|
|
![](images/spacer.gif) |
|