Do you know how he stores the amount, because I'm correting his code now for you.
HERE EET EES! Changes from the original are bolded, comments are italicized.
Code: ::"Deal or No Deal-by Daniel D.
::(Hexcode for a good DCS logo here)
:SetUpEditor DHI
:If dim(∟DHI)=0
:{0,0,0,0,0,0,0,0,0,0,0→DHI
:ClrHome
:Output(2,3,"Deal
:Output(3,7,"or
:Output(4,8,"No Deal
:Output(7,3,"based on the
:Output(8,3,"NBC gameshow
:getKey
:Repeat getKey
:For(X,1,8
:Output(X,1,"o
:Output(X,16,"o
:End
:For(X,0,100
:End
:For(X,1,8
:Output(X,1,"O
:Output(X,16,"O
:End
:For(X,0,100
:End
:For(X,1,8
:Output(X,1,"*
:Output(X,16,"*
:End
:For(X,0,100
:End
:End
:Lbl MM
:ClrHome
:Menu("DEAL OR NO DEAL ","Play",PG,"Highscores",HI,"Exit",EX
:Lbl HI
:ClrHome
:Disp " HIGHSCORES ","--------------"
:For(X,3,7
:Output(X,8,"[]
:End
:Output(8,1,"--------------
:For(X,1,5
:Output(X+2,1,∟DHI(X+1
:Output(X+2,10,∟DHI(X+6
:End
:Lbl Z
:getKey
:Repeat K≠0
:getKey→K
:End
:If K=31
:Then
:ClrHome
:(Find out how he stores the amount and make it display the way you want)
:Goto Z
:End
:If K=45
:Then
:Fill 0,∟DHI
:Goto HI
:End
:Goto MM
:Lbl EX
:DelVar ∟CS
:DelVar ∟P1
:DelVar ∟AMO
:DelVar [A]
:DelVar Pic1
:DelVar Pic2
:ClrDraw
:ClrHome
:Archive ∟DHI
:Output(1,1,"
:Stop
:Lbl PG
:26→dim(∟CS
:Fill 0,∟CS
:Output(4,1,"Loading Case:
:{.01,1,5,10,25,50,75,100,200,300,400,500,750,1000,5000,10000,25000,50000,75000,
100000,200000,300000,400000,500000,750000,1000000→∟AMO
:For(X,1,26
:Lbl RE
:randInt(1,26)→Y
:If ∟CS(Y)≠0
:Goto RE
:∟AMO(X→∟CS(Y
:Output(4,14,X
:End
:Lbl S2
:ClrHome
:Disp "Choose your case
:Input "(1-26):",X
:If fPart(X)≠0 or X<1 or X>26
:Goto S2
:{X,∟CS(X),0,∟CS(X)→P1
:∟CS(26→∟CS(X
:0→X
:{5,5}→dim([A]
:For(A,1,5
:For(B,1,5
:X+1→X
:∟CS(X→[A](A,B
:End
:End
:0→W
:0→L
:0→M
:7→C
:7→F
:0→Xmin
:0→Ymin
:62→Ymax
:94→Xmax
:AxesOff
:Lbl VB
:ClrDraw
:ClrHome
:If F=C
:Then
:If W=1
:Then
:Disp "The Banker is","thinking...
:DelVar ∟CS
:1→Z
:For(X,1,5
:For(Y,1,5
:If [A](X,Y)≠0
:Then
:[A](X,Y)→∟CS(Z
:Z+1→Z
:End
:End
:End
:∟P1(2→∟CS(Z
:round(mean(∟CS)1/C,2→X
:Output(1,12,"will
:Output(2,1,"give you
:Output(3,1,"
:Fix 2
:Output(3,2,X
:Float
:Output(4,1,"for your case.
:0→Z
:Output(6,3,"NO DEAL
:Output(7,3,"DEAL
:getKey
:Repeat K=21 or K=105
:getKey→K
:If K=31
:Then
:ClrDraw
:RecallPic 2
:getKey
:Repeat getKey
:End
:Disp
:End
:If K=25 or K=34
:not(Z→Z
:If Z=0
:Then
:Output(6,2,"
:Output(7,2,"
:Else
:Output(6,2,"
:Output(7,2,"
:End
:End
:If Z=1
:Then
:{.5,X,∟P1(3),∟P1(4→P1
:Goto DM
:End
:ClrDraw
:End
:If C≠1
:Then
:C-1→C
:Else
:L+1→L
:End
:If L=4
:Then
:ClrHome
:Disp "There is one","case left. You","can keep your's","or switch with","the last one.
:Output(7,3,"KEEP
:Output(8,3,"SWITCH
:0→Z
:getKey
:Repeat K=105 or K=21
:getKey→K
:If K=25 or K=34
:not(Z→Z
:If Z=0
:Then
:Output(7,2,"
:Output(8,2,"
:Else
:Output(7,2,"
:Output(8,2,"
:End
:End
:If Z=1
:Then
:For(X,1,5
:For(Y,1,5
:If [A](X,Y)≠0
:[A](X,Y)→∟P1(2
:End
:End
:End
:Goto DM
:End
:0→F
:ClrHome
:Disp "You have","cases to open","before the next","offer.
:If C=1
:Output(2,5," to open
:Output(1,10,C
:getKey
:Repeat getKey
:End
:End
:If W=1
:Goto S1
:For(B,3,51,12
:For(A,2,62,15
:Line(A,B,A,B+7
:Line(A+10,B,A+10,B+7
:Line(A+1,B-1,A+9,B-1
:Line(A+9,B+8,A+1,B+8
:End
:End
:0→X
:For(B,5,53,12
:For(A,6,66,15
:X+1→X
:If X=∟P1(1
:X+1→X
:If X<10
:Text(B,A,X
:If X>9
:Text(B,A-2,X
:End
:End
:Line(82,2,90,2
:Line(82,11,90,11
:Line(81,3,81,10
:Line(91,3,91,10
:Text(10,79,"Deal
:Text(16,83,"or
:Text(22,83,"No
:Text(28,79,"Deal
:If ∟P1(1)<10
:Text(53,85,∟P1(1
:If ∟P1(1)≥10
:Text(53,83,∟P1(1
:For(A,0,62
:For(B,77,94
:Pxl-Change(A,B
:End
:End
:StorePic 1
:3→A
:58→B
:Lbl S1
:If M=1
:ClrDraw
:RecallPic 1
:Text(39,84," ",C-F
:Line(84,17,88,17,0
:If W=1 and M=0
:Then
:For(Z,B+1,B-8,‾1
:Line(A-1,Z,A+9,Z,0
:End
:StorePic 1
:End
:0→M
:getKey
:Lbl LP
:getKey→K
:If K=31
:Then
:ClrDraw
:RecallPic 2
:getKey
:Repeat getKey
:End
:1→M
:End
:If M=1
:Goto S1
:[A]((58-B+12)/12,(A+12)/15)→∟P1(3
:∟P1(3→X
:If K=21 and X≠0 or K=105 and X≠0
:Goto OC
:If K≥24 and K≤26 or K=34
:Then
:Line(A,B,A,B-7,0
:Line(A,B,A+8,B,0
:Line(A+8,B,A+8,B-7,0
:Line(A,B-7,A+8,B-7,0
:End
:A-15(K=24 and A≠3)+15(K=26 and A≠63)→A
:B+12(K=25 and B≠5-12(K=34 and B≠10)→B
:Line(A,B,A,B-7
:Line(A,B,A+8,B
:Line(A+8,B,A+8,B-7
:Line(A,B-7,A+8,B-7
:Goto LP
:Lbl OC
:ClrDraw
:Line(19,10,19,45
:Line(75,10,75,45
:Line(19,10,75,10
:Line(19,45,75,45
:Line(1,9,94,9
:Line(35,50,59,50
:Line(35,48,59,48
:Line(35,50,35,45
:Line(59,50,59,45
:For(X,0,800
:End
:[A]((58-B+12)/12,(A+12)/15)→X
:int(log(X))+1→Y
:48-3Y→Z
:If Y>3
:Z-3→Z
:If Y=‾1
:Text(‾1,31,38,X
:If Y>0 and Y<4
:Text(‾1,31,Z,X
:If Y>3 and Y<7
:Text(‾1,31,Z,X/1000,",000
:If Y=7
:Text(‾1,31,21,"1,000,000
:getKey
:Repeat getKey
:End
:F+1→F
:Lbl AB
:ClrDraw
:If W=0
:Then
:0→Z
:For(Y,3,65,31
:For(X,2,50,6
:Z+1→Z
:Text(X,Y,∟AMO(Z
:If Z=26
:50→X
:End
:End
:Line(0,5,93,5
:Line(0,62,93,62
:Line(0,5,0,62
:Line(93,5,93,62
:Line(31,5,31,62
:Line(62,5,62,62
:StorePic 2
:End
:RecallPic 2
:‾4→U
:3→V
:0→Z
:Repeat ∟P1(3)=∟AMO(Z
:Z+1→Z
:If U=50
:Then
:‾4→U
:V+31→V
:End
:U+6→U
:End
:For(P,U,U+5
:For(Q,V-2,V+27
:Pxl-Change(P,Q
:End
:End
:StorePic 2
:getKey
:Repeat getKey
:End
:0→[A]((58-B+12)/12,(A+12)/15
:1→W
:Goto VB
:Lbl DM
:ClrHome
:Disp "You won:","
:If ∟P1(1)=.5
:Then
:Output(6,1,"Your case had:
:Output(7,1,"
:Output(7,2,∟P1(4
:End
:∟P1(2→Y
:Fix 2
:Output(2,2,Y
:Float
:If Y>∟DHI(11
:Then
:Output(4,1,"*NEW HIGH SCORE*
:For(X,11,2,‾1
:If Y>∟DHI(X)
:X→θ
:End
:For(X,11,θ,‾1
:∟DHI(X-1→∟DHI(X
:End
:Y→∟DHI(θ
:End
:getKey
:Repeat getKey
:End
:Goto HI
Last edited by Guest on 16 Oct 2009 05:37:10 pm; edited 1 time in total |