Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / tic tac toe game

Author
Message
Chaos
22
Years of Service
User Offline
Joined: 8th Feb 2003
Location: United Kingdom
Posted: 23rd Mar 2003 15:07
im not sure where to post this so i will post it here. I coded this in about 30 minutes and it is my first proper demo.



any comments would be great and i hope it helps some people. Note it includes some simple media just open up a paint proggey and make a simple empty square ,one with a cross and one with a circle and call then tic tac and toe. leftclick for circle and right click for cross. Ok thanx
Darkworlds are all around us just open your eyes
Most of us are still half asleep
Hamish McHaggis
22
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 23rd Mar 2003 15:33
First of all, you really don't need to use media, just use the line commands in DB. Secondly, the clicking only works if your mouse is on a certain pixel, not within a certain area. I couldn't play it because my images I made were the wrong size, but I'm sure if you make those changes, it'll be good.

Why the hell'd you ask me for crying out loud!?!
Chaos
22
Years of Service
User Offline
Joined: 8th Feb 2003
Location: United Kingdom
Posted: 23rd Mar 2003 15:58
if u use image size 64x64 it will work.But i will make some changes
thanx jamie

Darkworlds are all around us just open your eyes
Most of us are still half asleep
Chaos
22
Years of Service
User Offline
Joined: 8th Feb 2003
Location: United Kingdom
Posted: 23rd Mar 2003 16:13
here the new code needs media still but allows you more movement to select squares improvement welcome
` code fo simple two player tic,tac,toe game
` written bye jamie lewis



Darkworlds are all around us just open your eyes
Most of us are still half asleep
Hamish McHaggis
22
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 23rd Mar 2003 17:49
Good! Now you could make it detect when someone has won and not let the other player go when it isn't thir go.

Why the hell'd you ask me for crying out loud!?!
Chaos
22
Years of Service
User Offline
Joined: 8th Feb 2003
Location: United Kingdom
Posted: 23rd Mar 2003 17:58
i would but im letting it go if anyone else wants to they are welcome to it. Im to busy working on an rpg to work on this it was just something i threw tother as a practice of using arrays.

Thanx anyway Hammish for your support.

Darkworlds are all around us just open your eyes
Most of us are still half asleep
Hamish McHaggis
22
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 23rd Mar 2003 18:14
I decided to make a version of it when I saw you were doing that, but I decided o make it Player vs. Computer, not player vs. player. Its on the code snippets section under "Unbeatable Game" . Thanks for the inspiration.

Why the hell'd you ask me for crying out loud!?!
Chaos
22
Years of Service
User Offline
Joined: 8th Feb 2003
Location: United Kingdom
Posted: 23rd Mar 2003 18:17
yeh i saw it that is one tough game i am studying the source and it looks relly good.

Darkworlds are all around us just open your eyes
Most of us are still half asleep
PiratSS
22
Years of Service
User Offline
Joined: 18th Oct 2002
Location:
Posted: 23rd Mar 2003 19:30
This may aid you a bit:

Minimatrix way for *SOLVED* Game.

http://www.cs.vu.nl/~victor

Tic Tac Toe has been solved by Vitor Allis.

Cheers.

1PH J00 C4|\| U|\|dER$T@|\||) +|-|I$, j00 |-|@\/3 4lR3Ady w0|\|! - p1r@T$$
Hamish McHaggis
22
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 23rd Mar 2003 19:32
The source is kind of messy. I should really have remarked it. But I'll explain quickly...

1 4 7
2 5 8
3 6 9

those are the numbers of the grid. I just test different possibilities, first I test to see if two circles are lined up with a space on the same row and if they are then the computer puts another circle in the space and wins. Next, if there weren't any like that, I test to see if there are two of the opponents crosses lined up with a space, and if there is, it sticks a circle there to block them.

The ones after that are testing the first moves from the other player and it has the best moves programmed into it.

Why the hell'd you ask me for crying out loud!?!

Login to post a reply

Server time is: 2025-05-17 03:03:24
Your offset time is: 2025-05-17 03:03:24