Home
Scripts
Malicious Scripts
DSINs
Help
About
Employment
Employees
Contact Us
Links
| |
Tic-Tac-Toe
getcolor
getbgcolor
color 3
bgcolor 4
var menuchoice
var pointx
var pointy
var draw
var mark11
var mark12
var mark13
var mark21
var mark22
var mark23
var mark31
var mark32
var mark33
var player1
var player2
var$ p1
var$ p2
var$ p3
var$ p4
! mark11 = %chr%
! mark12 = %chr%
! mark13 = %chr%
! mark21 = %chr%
! mark22 = %chr%
! mark23 = %chr%
! mark31 = %chr%
! mark32 = %chr%
! mark33 = %chr%
! draw = 0
@menu
cls
bgcolor black
color blue
say 10 /\/\/\/\/\/\/\/\/\/
color orange
say 10 Tic-Tac-Toe
color blue
say 10 \/\/\/\/\/\/\/\/\/\
color orange
say 10 By Omnicron Software
color blue
skipline
say 10 1. Play Tic-Tac-Toe
say 10 2. Quit
skipline
color white
INPUT menuchoice Please choose a number.
IF menuchoice = 1
goto gamestart
ENDIF
IF menuchoice = 2
goto quickquit
ENDIF
//ELSE
color blue
say 10 Sorry. Invalid Choice.
skipline
pause
skipline
goto menu
@gamestart
color white
skipline
SAY 10 To quit, type "quit" at any time.
skipline
INPUT player1 Who is going first?
IF player1 = quit
goto quickquit
endif
skipline
INPUT player2 Who is going second?
skipline
IF player1 = quit
goto quickquit
endif
strmid player1 1 1
ucase strmid
! p1=ucase
strmid player1 2 99
lcase strmind
! p2=strmid
strmid player2 1 1
ucase strmid
! p3=ucase
strmid player2 2 99
lcase strmind
! p4=strmid
@player1
//////////////
//Lose check//
//////////////
//Top to bottom
IF mark11 = O
IF mark12 = O
IF mark13 = O
color red
SAY 10 Sorry %p1%%p2%, you lose.
skipline
color green
SAY 10 CONGRATUlATIONS %p3%%p4%.
SAY 10 You've won the game!
goto quit
ENDIF
IF mark21 = O
IF mark22 = O
IF mark23 = O
color red
SAY 10 Sorry %p1%%p2%, you lose.
skipline
color green
SAY 10 CONGRATUlATIONS %p3%%p4%.
SAY 10 You've won the game!
goto quit
ENDIF
IF mark31 = O
IF mark32 = O
IF mark33 = O
color red
SAY 10 Sorry %p1%%p2%, you lose.
skipline
color green
SAY 10 CONGRATUlATIONS %p3%%p4%.
SAY 10 You've won the game!
goto quit
ENDIF
//Side to side
IF mark11 = O
IF mark21 = O
IF mark31 = O
color red
SAY 10 Sorry %p1%%p2%, you lose.
skipline
color green
SAY 10 CONGRATUlATIONS %p3%%p4%.
SAY 10 You've won the game!
goto quit
ENDIF
IF mark12 = O
IF mark22 = O
IF mark32 = O
color red
SAY 10 Sorry %p1%%p2%, you lose.
skipline
color green
SAY 10 CONGRATUlATIONS %p3%%p4%.
SAY 10 You've won the game!
goto quit
ENDIF
IF mark13 = O
IF mark23 = O
IF mark33 = O
color red
SAY 10 Sorry %p1%%p2%, you lose.
skipline
color green
SAY 10 CONGRATUlATIONS %p3%%p4%.
SAY 10 You've won the game!
goto quit
ENDIF
//Diagonal
IF mark11 = O
IF mark22 = O
IF mark33 = O
color red
SAY 10 Sorry %p1%%p2%, you lose.
skipline
color green
SAY 10 CONGRATUlATIONS %p3%%p4%.
SAY 10 You've won the game!
goto quit
ENDIF
IF mark31 = O
IF mark22 = O
IF mark13 = O
color red
SAY 10 Sorry %p1%%p2%, you lose.
skipline
color green
SAY 10 CONGRATUlATIONS %p3%%p4%.
SAY 10 You've won the game!
goto quit
ENDIF
///////////////////////////////////////////
IF draw = 9
color blue
SAY 10 Game drawn.
skipline
SAY 10 Restarting...
! mark11 = %chr%
! mark12 = %chr%
! mark13 = %chr%
! mark21 = %chr%
! mark22 = %chr%
! mark23 = %chr%
! mark31 = %chr%
! mark32 = %chr%
! mark33 = %chr%
! draw = 0
ENDIF
///////////////////////////////////////////
///////////////////////////////////////////
color white
skipline
SAY 10 %p1%%p2%, it's your go.
@player1x
skipline
INPUT pointx Where X?
IF pointx = quit
goto quickquit
endif
IF pointx > 3
say 10 Sorry. Stay below 3.
goto player1x
endif
IF pointx < 1
say 10 Sorry. Stay above 0.
goto player1x
endif
@player1y
INPUT pointy Where y?
IF pointy = quit
goto quickquit
endif
IF pointy > 3
say 10 Sorry. Stay below 3.
goto player1y
endif
IF pointy < 1
say 10 Sorry. Stay above 0.
goto player1y
endif
IF mark%pointx%%pointy% = X
SAY 10 Already gone there.
goto player1
ENDIF
IF mark%pointx%%pointy% = O
SAY 10 Already gone there.
goto player1
ENDIF
! mark%pointx%%pointy% = X
skipline
COLOR Blue
SAY 1 X 1 2 3
SAY 1 Y---------------
color white
SAY 1 1|%mark11%||%mark21%||%mark31%|
color blue
SAY 1 --------------
color white
SAY 1 2|%mark12%||%mark22%||%mark32%|
color blue
SAY 1 --------------
color white
SAY 1 3|%mark13%||%mark23%||%mark33%|
color blue
SAY 1 --------------
skipline
! draw = %draw% + 1
@player2
//////////////
//Lose check//
//////////////
//Top to bottom
IF mark11 = X
IF mark12 = X
IF mark13 = X
color red
SAY 10 Sorry %p3%%p4%, you lose.
skipline
color green
SAY 10 CONGRATUlATIONS %p1%%p2%.
SAY 10 You've won the game!
goto quit
ENDIF
IF mark21 = X
IF mark22 = X
IF mark23 = X
color red
SAY 10 Sorry %p3%%p4%, you lose.
skipline
color green
SAY 10 CONGRATULATIONS %p1%%p2%.
SAY 10 You've won the game!
goto quit
ENDIF
IF mark31 = X
IF mark32 = X
IF mark33 = X
color red
SAY 10 Sorry %p3%%p4%, you lose.
skipline
color green
SAY 10 CONGRATULATIONS %p1%%p2%.
SAY 10 You've won the game!
goto quit
ENDIF
//Side to side
IF mark11 = X
IF mark21 = X
IF mark31 = X
color red
SAY 10 Sorry %p3%%p4%, you lose.
skipline
color green
SAY 10 CONGRATULATIONS %p1%%p2%.
SAY 10 You've won the game!
goto quit
ENDIF
IF mark12 = X
IF mark22 = X
IF mark32 = X
color red
SAY 10 Sorry %p3%%p4%, you lose.
skipline
color green
SAY 10 CONGRATULATIONS %p1%%p2%.
SAY 10 You've won the game!
goto quit
ENDIF
IF mark13 = X
IF mark23 = X
IF mark33 = X
color red
SAY 10 Sorry %p3%%p4%, you lose.
skipline
color green
SAY 10 CONGRATULATIONS %p1%%p2%.
SAY 10 You've won the game!
goto quit
ENDIF
//Diagonal
IF mark11 = X
IF mark22 = X
IF mark33 = X
color red
SAY 10 Sorry %p3%%p4%, you lose.
skipline
color green
SAY 10 CONGRATULATIONS %p1%%p2%.
SAY 10 You've won the game!
goto quit
ENDIF
IF mark31 = X
IF mark22 = X
IF mark13 = X
color red
SAY 10 Sorry %p3%%p4%, you lose.
skipline
color green
SAY 10 CONGRATULATIONS %p1%%p2%.
SAY 10 You've won the game!
goto quit
ENDIF
///////////////////////////////////////////
IF draw = 9
color blue
SAY 10 Game drawn.
skipline
SAY 10 Restarting...
! mark11 = E
! mark12 = E
! mark13 = E
! mark21 = E
! mark22 = E
! mark23 = E
! mark31 = E
! mark32 = E
! mark33 = E
! draw = 0
ENDIF
///////////////////////////////////////////
///////////////////////////////////////////
color white
SAY 10 %p3%%p4% - It's your go.
@player2x
skipline
INPUT pointx Where X?
IF pointx = quit
goto quickquit
endif
IF pointx > 3
say 10 Sorry. Stay below 3.
goto player2x
endif
IF pointx < 1
say 10 Sorry. Stay above 0.
goto player2x
endif
@player2y
INPUT pointy Where y?
IF pointy = quit
goto quickquit
endif
IF pointy > 3
say 10 Sorry. Stay below 3.
goto player2y
endif
IF pointy < 1
say 10 Sorry. Stay above 0.
goto player2y
endif
IF mark%pointx%%pointy% = X
SAY 10 Already gone there.
goto player2
ENDIF
IF mark%pointx%%pointy% = O
SAY 10 Already gone there.
goto player2
ENDIF
! mark%pointx%%pointy% = O
skipline
COLOR Blue
SAY 1 X 1 2 3
SAY 1 Y---------------
color white
SAY 1 1|%mark11%||%mark21%||%mark31%|
color blue
SAY 1 --------------
color white
SAY 1 2|%mark12%||%mark22%||%mark32%|
color blue
SAY 1 --------------
color white
SAY 1 3|%mark13%||%mark23%||%mark33%|
color blue
SAY 1 --------------
skipline
! draw = %draw% + 1
goto player1
@quit
skipline
pause
skipline
@quickquit
CLS
color blue
say 10 Thank you for playing
color orange
say 10 Omnisoft Tic-Tac-Toe
skipline
color blue
say 10 Visit us on the web at
color green
say 10 http://clix.to/omnisoft
skipline
color White
SAY 10 Please tell all your friends about us!
skipline
SAY 10 This script is freeware, feel free to post
SAY 10 an un-edited version of it on any form of
SAY 10 electronic distribution system (BBS, FIDO,
SAY 10 e-mail etc.)
skipline
// Return all original values
color 4
bgcolor 5
color %getcolor%
bgcolor %getbgcolor%
//Quit
END |
|