NAIVE的曾經(jīng)(1)

這個程序是我剛學(xué)完Free PASCAL的語法時自己編的,現(xiàn)在看來有點智障,不過那時還玩的挺開心的。

拿出來分享下。


一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一

const

a1=5;

a2=10;

a3=20;

a4=50;

a5=100;

a6=500;

var

i,j,a,b,n,sum,last,first:longint;

procedure r(var sum,a,n:longint) ;

var

b:longint;

begin

n:=n+1;

sum:=sum-a;

writeln('You lose ',a,'$');

randomize;

b:=random(a*2);

writeln('You get ',b,'$');

sum:=sum+b;

if sum < a1 then

begin

writeln('Ha ha , you are too poor to play this game, and get out!');

readln;

halt;

end;

writeln('Now you have ',sum,'$');

end;

begin

writeln('THK`s game.');

for i:=1 to 10 do

begin

for j:=1 to 70 do

if j mod 2 = 0 then write('-') else write(' ');

writeln;

end;

writeln('Please write how much money do you have:');

readln(first);

writeln('Please write how much money do you want:');

readln(last);

if first < last then

begin

writeln('Ok. Game begin!');

n:=0;

sum:=first;

while sum < last do

begin

if n=0 then

begin

writeln('You want to get ',last,'$ , Now you have ',sum,'$');

writeln('You can pay ',a1,'$? ',a2,'$? ',a3,'$? ',a4,'$? ',a5,'$? ',a6,'$ to play this game, and you will get the money!');

writeln('What do you want?');

end;

readln(a);

r(sum,a,n);

end;

writeln('Excellent! You have got so much money!');

end

else writeln ('Shit!');

readln;

writeln('Please remember:THK made this game!');

readln;

end.

一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一


圖1
圖2
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容