So I'm having trouble with this multiplayer turned based BASIC program. I'm trying to make it so that each player selects an action from the menu and the selection is stored as the A variable for Calc 1's choice and the B variable for Calc 2's choice.
I started off by making the menu appear for Calc 1 and a waiting screen for Calc 2 until Calc 1 makes a selection.
Code:
Works great; both Calculator's A variables are the same (although Calc 1 experiences some major lag in the menu. If anyone knows a solution to that, that would help too).
Since this worked, I figured I could just copy the code and adjust it in order to use it for Calc 2's turn.
Code:
However, now Calc 2 never gets Calc 1's A, keeping Calc 2 stuck in its while loop. I tried deleting the A and B variables at the beginning of Lbl 1θ, but that didn't seem to have any effect.
I feel like there is a simple answer for this and I'm just not seeing it. Or maybe I need to do the waiting part in a different way.
I started off by making the menu appear for Calc 1 and a waiting screen for Calc 2 until Calc 1 makes a selection.
Code:
DelVar A:DelVar B
GetCalc(θ
e(θ=π)+π(θ≠π→θ
ClrHome
If θ=π:Menu("CALC1","ATTACK",1A,"DEFEND",1D,"SKIP",1S
If θ=e
Then
Disp "WAITING...
While A=0
GetCalc(A
End
Lbl 1A: A→1:Goto 1θ
Lbl 1D: A→2:Goto 1θ
Lbl 1S: A→3:Goto 1θ
Lbl 1θ
Works great; both Calculator's A variables are the same (although Calc 1 experiences some major lag in the menu. If anyone knows a solution to that, that would help too).
Since this worked, I figured I could just copy the code and adjust it in order to use it for Calc 2's turn.
Code:
ClrHome
If θ=π:Menu("CALC1","ATTACK",1A,"DEFEND",1D,"SKIP",1S
If θ=e
Then
Disp "WAITING...
While A=0
GetCalc(A
End
Lbl 1A: A→1:Goto 1θ
Lbl 1D: A→2:Goto 1θ
Lbl 1S: A→3:Goto 1θ
Lbl 1θ
ClrHome
If θ=e:Menu("CALC2","ATTACK",2A,"DEFEND",2D,"SKIP",2S
If θ=π
Then
Disp "WAITING...
While B=0
GetCalc(B
End
Lbl 2A: B→1:Goto 2θ
Lbl 2D: B→2:Goto 2θ
Lbl 2S: B→3:Goto 2θ
Lbl 2θ
However, now Calc 2 never gets Calc 1's A, keeping Calc 2 stuck in its while loop. I tried deleting the A and B variables at the beginning of Lbl 1θ, but that didn't seem to have any effect.
I feel like there is a simple answer for this and I'm just not seeing it. Or maybe I need to do the waiting part in a different way.