Run DOS Remake
The remake keeps command-first betting flow with Enter-driven prompts.
Commands: O/E/H/L/G bet mode, whole-dollar wager, 0-36 guess for G, Y/N replay, RESET restart.
This remake recreates one of my early Turbo Pascal projects as a browser terminal artifact, preserving the prompt-driven loop and the original bet-and-bank structure.
The remake keeps command-first betting flow with Enter-driven prompts.
Commands: O/E/H/L/G bet mode, whole-dollar wager, 0-36 guess for G, Y/N replay, RESET restart.
P4CBF.PAS was a school-era exercise in structured Pascal: typed input,
random number generation, branch-heavy payout logic, and persistent bank state.
The original ran in a text DOS console and asked the player to repeatedly bet, spin, and decide whether to continue.
1) Bank Initialization
var
Bank:real;
...
Bank:=1000; 2) Spin Generation (0 to 36)
procedure DoSpin(var Num:integer);
begin
randomize;
Num:=random(37);
end; 3) Win/Loss Branching
case Choice of
'O','o' : if Num mod 2=0 then
Youlose(Bank,Bet)
else YouWin(Bank,Bet);
'G','g' : if Num=Guess then
YouWinBig(Bank,Bet)
else YouLose(Bank,Bet);
end; procedure AdjustMoney(var Bank:real;Choice:char;Num,Guess:integer;Bet:real);
begin
case Choice of
'O','o' : if Num mod 2=0 then
Youlose(Bank,Bet)
else YouWin(Bank,Bet);
'E','e' : if Num mod 2=0 then
YouWin(Bank,Bet)
else YouLose(Bank,Bet);
'H','h' : if Num >=19 then
YouWin(Bank,Bet)
else YouLose(Bank,Bet);
'L','l' : if Num >=19 then
YouLose(Bank,Bet)
else YouWin(Bank,Bet);
'G','g' : if Num=Guess then
YouWinBig(Bank,Bet)
else YouLose(Bank,Bet);
end;
end;
procedure SpinOnce(var Bank:real);
var
Bet:real;
Num:integer;
Guess:integer;
Choice:char;
Choice2:char;
begin
repeat
GetBet(Bank,Choice,Guess,Bet);
DoSpin(Num);
AdjustMoney(Bank,Choice,Num,Guess,Bet);
writeln('You still have $',Bank:2:2,' left!');
readln(Choice2);
until (Bank<=0) or (Choice2='N') or (Choice2='n');
end;