Connect Four with CASIO BASIC
by sonone, Jun 16, 2021, 3:56 PM
Hey everyone!
I made a Connect Four (two players) program on my CASIO fx-9750GII using the CASI BASIC programming language.
Here are the features:
Press the left and right arrows to move columns
The EXE button places your chip
When a column is full, the
will become a
on the column
You win by getting four of the same chips in a row vertically, horizontally or diagonally
Here is some other useful info:
Uses 1084 bytes of memory
119 lines
BAISC code
P.S. I learned CASIO BASIC from the software guide (too large to attach), if anyone is interested. Page 212 (8-1)
I made a Connect Four (two players) program on my CASIO fx-9750GII using the CASI BASIC programming language.
Here are the features:
Press the left and right arrows to move columns
The EXE button places your chip
When a column is full, the


You win by getting four of the same chips in a row vertically, horizontally or diagonally
Here is some other useful info:
Uses 1084 bytes of memory
119 lines
BAISC code
ClrText
[[0,0,0,0,0,0,0][0,0,0,0,0,0,0][0,0,0,0,0,0,0][0,0,0,0,0,0,0][0,0,0,0,0,0,0][0,0,0,0,0,0,0]]->Mat A
{0,0,0,0,0,0,0}->List 1
"<DOUBLE VERTICAL LINES>"->Str 1
"="->Str 2
"#"->Str 3
"<UPARROW>"->Str 4
"<XCROSS>"->Str 5
For 1->I To 7
If I≠7
Then Locate 13,I,Str 1
Locate 21,I,Str 1
IfEnd
Locate I+13,7,Str 2
Next
Locate 13,7,Str 3
Locate 21,7,Str 3
Locate 1,6,"press EXE"
Locate 1,7,"place chip"
1->C
1->K
0->Q
Locate 14,7,Str 4
Lbl M
Locate 1,1,"player"
Locate 8,1,K
Locate 1,2,"column:"
If Getkey=38 And C>1
Then Locate 13+C,7,Str 2
C-1->C
If List 1[C]≥5
Then Locate 13+C,7,Str 5
Else Locate 13+C,7,Str 4
IfEnd
IfEnd
If Getkey=27 And C<7
Then Locate 13+C,7,Str 2
C+1->C
If List 1[C]≥5
Then Then Locate 13+C,7,Str 5
Else Locate 13+C,7,Str 4
IfEnd
IfEnd
Locate 8,2,C
List 1[C]->D
If Getkey=31 And D<6
Then Q+1->Q
If K=1
Then 2->K
Else 1->K
IfEnd
K->Mat A[6-D,C]
If K=1
Then Locate 13+C,6-D,"<FILLED CIRCLE>"
Else Locate 13+C,6-D,"<OPEN CIRCLE>"
IfEnd
D+1->D
D->List 1[C]
D=6=>Locate 13+C,7,Str 5
0->W
For 1-I To 6
If Mat A[I,C]=K
Then W+1->W
W=4=>Goto F
Else 0->W
IfEnd
Next
0->W
For 1-I to 7
If Mat A[7-D,I]=K
Then W+1->W
W=4=>GoTo F
Else 0->W
IfEnd
Next
0->W
If C≥D
Then C-D+1->L
1->R
Else 1->L
D-C+1->R
IfEnd
While L≤7 And R≤6
If Mat A[7-R,L]=K
Then W+1->W
Else 0->W
IfEnd
W=4=>Goto F
R+1->R
L+1->L
WhileEnd
0->W
If 8-C≥D
Then 1->R
C+D-1->L
Else 7->L
D+C-8->R
IfEnd
While L≥1 And R≤6
If Mat A[7-R,L]=K
Then W+1->W
Else 0->W
IfEnd
W=4=>Goto F
L-1->L
R+1->R
WhileEnd
Q=42=>Goto T
IfEnd
While Getkey=31
WhileEnd
Goto M
ClrList 1
ClrMat A
Lbl T
Locate 1,4,"tie :("
Stop
Lbl F
Locate 1,4,"you win!"
P.S. I learned CASIO BASIC from the software guide (too large to attach), if anyone is interested. Page 212 (8-1)