SRL Archive - Other Scripts

Tic-Tac-Toe!


XxKanexX

2006-07-04 08:20:51

Well, a re-create of my old script. Alot, and i mean, Alot better! This took me a while, because i didn't want to waste useless lines like in my last script, So i tried making up methods, which worked.

How To Use:


When you first begin you will be given a player, It will be displayed at the Right of the game. "X" meaning Crosses and "O" meaning Naughts. When someone wins their' Combination will light up in Red and their' Score will become bold.

Everytime you win, you will recieve two points. It's the same with the computer, too.

When the board is full from a Tie both players will recieve 2 points. To play a New game after the board's full, a player has won, or if you don't like the way the game's going, Press the "New Game" button on the right.

To position your player, Click on any of the "available" squares :)

Features:


I made the computer smart, at times.. Meaning it will, at random, try to defend you winning (If it didn't go for its own win).

Known Errors:


It lags a little (Only for a split seconds or less..). This is because it go's through about 5 while loops each time someone positions (You hardly notice this lag, though).

Other than them i don't know if there are any more errors, please post them if you enquire one.

Tic Tac Toe CHEAT:


I added TicTacToe_Cheat for people who want the computer to be harder. The computer cheats in there nearly every game by taking 2 moves. Also, in both games, the higher you get your score the more will be added on the next win ;) You can still win, though.

Enjoy Tic Tac Toe!
-XxKanexX

XxKanexX

2006-07-04 09:24:06

Found another error: Sometimes the scores play up, The computer may get 4 points each win.. But i guess it keeps it even, as the Computer is quite easy to beat. :)

Goldec

2006-07-04 11:02:53

Nice script! Computer should be smarter!

XxKanexX

2006-07-04 11:08:38

From: Goldec
Nice script! Computer should be smarter!

I'll see what i can do in the future ;) I'm glad you liked it. :)

KyleGut3

2006-07-04 12:02:34

I'd have to say this is pretty damned cool.

Avaphi

2006-07-04 12:12:02

Awesome Job Kane !… Have you ever thought of making an RPG in scar ?…

Ron

2006-07-04 12:20:25

Cool script. The computer is soooo easy to beat lol. I did lose once cause it switches who you are every game I think. Nice work. :D

shaunthasheep

2006-07-04 14:46:06

im gonna make a harder one, ok :D (uses ur form :P)

AI will be extremely hard to beat :D

The Un-Named

2006-07-04 15:43:42

From: The_Rs_Monkey
im gonna make a harder one, ok :D (uses ur form :P)

AI will be extremely hard to beat :D


If you mean


[FONT="Courier New"]
x| |x
| |
x| |

[/FONT]

Then dam, you'll be right. :p

shaunthasheep

2006-07-04 20:57:12

well… who said the computer will win? its more like a cats game..

i found this example of TicTacToe [Ai] in visual basic 6, im gonna try to convert, it was a well good code. i couldbt beet it :rolleyes:

XxKanexX

2006-07-04 23:03:23

I could make it alot harder (Checking every single way that the player could go), At the moment it only checks the first one; And only sometimes moves there ;)

From: Rs_Monkey
im gonna make a harder one, ok (uses ur form :P)

AI will be extremely hard to beat

Did i give you permission to use my form? No. Make your own, please.

Edit: I added TicTacToe_Cheat for people who want the computer to be harder. The computer cheats in there nearly every game by taking 2 moves. Also, in both games, the higher you get your score the more will be added on the next win ;)

puj

2006-07-05 10:49:12

I really like this script.

I have noticed though that the score updates after you click new game, so then the writing that is bold is your old score. I would be better if it updated first. :)

XxKanexX

2006-07-05 11:34:52

Yeh, well clicking New Game resets the text :) So that's why it does that.