tic-tac-toe
dim a
dim b
dim c
dim d
dim e
dim f
dim g
dim h
dim i
dim aa
dim bb
dim cc
dim dd
dim ee
dim ff
dim gg
dim hh
dim ii
dim xgl1
dim xgl2
dim xgl3
dim xgc1
dim xgc2
dim xgc3
dim xgd1
dim xgd2
dim ogl1
dim ogl2
dim ogl3
dim ogc1
dim ogc2
dim ogc3
dim ogd1
dim ogd2
dim tour
dim tourm
dim inputm
dim input
a = 1
b = 2
c = 3
d = 4
e = 5
f = 6
g = 7
h = 8
i = 9
aa = 0
bb = 0
cc = 0
dd = 0
ee = 0
ff = 0
gg = 0
hh = 0
ii = 0
xgl1 = 0
xgl2 = 0
xgl3 = 0
xgc1 = 0
xgc2 = 0
xgc3 = 0
xgd1 = 0
xgd2 = 0
ogl1 = 0
ogl2 = 0
ogl3 = 0
ogc1 = 0
ogc2 = 0
ogc3 = 0
ogd1 = 0
ogd2 = 0
tourm = 0
tour = 0
msgbox"Bienvenue sur Tic-Tac-Toe !"
inputm = cint(inputbox("Que veux-tu faire ?"_
+chr(13)_
+"1 - Jouer "_
+chr(13)_
+"2 - Règle "_
+chr(13)_
+"3 - Crédit "))
if (inputm = 2) then
msgbox("Les Règles:"_
+chr(13)_
+chr(13)_
+"Le but est d'aligner 3 pions de ta couleur."_
+chr(13)_
+"Pour cela il te suffit tour à tour"_
+chr(13)_
+"de choisir une case non utilisée")
inputm = 3
end if
if (inputm = 3) then
msgbox"Jeu développé par"_
+chr(13)_
+"Yannyellowgame"_
+chr(13)_
+chr(13)_
+"Dedicace:"_
+chr(13)_
+"Tutolande"_
+chr(13)_
+"pour m'avoir appris le VBS"_
inputm = 1
end if
if (inputm = 1) then
do
input = cint(inputbox(" "&a&" # "&b&" # "&c&""_
+chr(13)_
+" ###########"_
+chr(13)_
+" "&d&" # "&e&" # "&f&" Votre choix ?"_
+chr(13)_
+" ###########"_
+chr(13)_
+" "&g&" # "&h&" # "&i&""_
+chr(13)_
+" "))
if (tour = 0) then
if (input = 1) then
if (aa = 0) then
a = "x"
aa = 1
xgl1 = xgl1 + 1
xgc1 = xgc1 + 1
xgd1 = xgd1 + 1
tour = 1
tourm = tourm + 1
end if
end if
if (input = 2) then
if (bb = 0) then
b = "x"
bb = 1
xgl1 = xgl1 + 1
xgc2 = xgc2 + 1
tour = 1
tourm = tourm + 1
end if
end if
if (input = 3) then
if (cc = 0) then
c = "x"
cc = 1
xgl1 = xgl1 + 1
xgc3 = xgc3 + 1
xgd2 = xgd2 + 1
tour = 1
tourm = tourm + 1
end if
end if
if (input = 4) then
if (dd = 0) then
d = "x"
dd = 1
xgl2 = xgl2 + 1
xgc1 = xgc1 + 1
tour = 1
tourm = tourm + 1
end if
end if
if (input = 5) then
if (ee = 0) then
e = "x"
ee = 1
xgl2 = xgl2 + 1
xgc2 = xgc2 + 1
xgd1 = xgd1 + 1
xgd2 = xgd2 + 1
tour = 1
tourm = tourm + 1
end if
end if
if (input = 6) then
if (ff = 0) then
f = "x"
ff = 1
xgl2 = xgl2 + 1
xgc2 = xgc2 + 1
tour = 1
tourm = tourm + 1
end if
end if
if (input = 7) then
if (gg = 0) then
g = "x"
gg = 1
xgl3 = xgl3 + 1
xgc1 = xgc1 + 1
tour = 1
tourm = tourm + 1
end if
end if
if (input = 8) then
if (hh = 0) then
h = "x"
hh = 1
xgl3 = xgl3 + 1
xgc2 = xgc2 + 1
xgd2 = xgd2 + 1
tour = 1
tourm = tourm + 1
end if
end if
if (input = 9) then
if (ii = 0) then
i = "x"
ii = 1
xgl3 = xgl3 + 1
xgc3 = xgc3 + 1
xgd1 = xgd1 + 1
tour = 1
tourm = tourm + 1
end if
end if
end if
if (tour = 1) then
if (aa = 0) then
a = "0"
aa = 1
ogl1 = ogl1 + 1
ogc1 = ogc1 + 1
ogd1 = ogd1 + 1
tour = 0
tourm = tourm + 1
end if
end if
if (input = 2) then
if (bb = 0) then
b = "0"
bb = 1
ogl1 = ogl1 + 1
ogc2 = ogc2 + 1
tour = 0
tourm = tourm + 1
end if
end if
if (input = 3) then
if (cc = 0) then
c = "0"
cc = 1
ogl1 = ogl1 + 1
ogc3 = ogc3 + 1
ogd2 = ogd2 + 1
tour = 0
tourm = tourm + 1
end if
end if
if (input = 4) then
if (dd = 0) then
d = "0"
dd = 1
ogl2 = ogl2 + 1
ogc1 = ogc1 + 1
tour = 0
tourm = tourm + 1
end if
end if
if (input = 5) then
if (ee = 0) then
e = "0"
ee = 1
ogl2 = ogl2 + 1
ogc2 = ogc2 + 1
ogd1 = ogd1 + 1
ogd2 = ogd2 + 1
tour = 0
tourm = tourm + 1
end if
end if
if (input = 6) then
if (ff = 0) then
f = "0"
ff = 1
ogl2 = ogl2 + 1
ogc2 = ogc2 + 1
tour = 0
tourm = tourm + 1
end if
end if
if (input = 7) then
if (gg = 0) then
g = "0"
gg = 1
ogl3 = ogl3 + 1
ogc1 = ogc1 + 1
tour = 0
tourm = tourm + 1
end if
end if
if (input = 8) then
if (hh = 0) then
h = "0"
hh = 1
ogl3 = ogl3 + 1
ogc2 = ogc2 + 1
ogd2 = ogd2 + 1
tour = 0
tourm = tourm + 1
end if
end if
if (input = 9) then
if (ii = 0) then
i = "0"
ii = 1
ogl3 = ogl3 + 1
ogc3 = ogc3 + 1
ogd1 = ogd1 + 1
tour = 0
tourm = tourm + 1
end if
end if
if (xgl1 = 3) or (xgl2 = 3) or (xgl3 = 3) or (xgc1 = 3) or (xgc2 = 3) or (xgc3 = 3) or (xgd1 = 3) or(xgd2 = 3) then
msgbox"Les x gagne"
Wscript.quit
end if
if (ogl1 = 3) or (ogl2 = 3) or (ogl3 = 3) or (ogc1 = 3) or (ogc2 = 3) or (ogc3 = 3) or (ogd1 = 3) or(ogd2 = 3) then
msgbox"Les 0 gangne"
Wscript.quit
end if
if (tourm = 9) then
msgbox"Match nulle"
Wscript.quit
end if
loop
end if