I'm having trouble with printing List values. For one, am I supposed to be using PrintUInt(), and if not, what? The second thing might be that its not printing the list value, but my code that is wrong. Please bear with me with all the subprograms. They were meant to help edit the program easier. In my program, when I try to print out my list value (e.g. PrintUInt(L1(3*7*ICUR))), it prints out numbers that I did not want (they seem kind of random too and dont correspond to anything thats SHOULD be in the list). Btw, if you look in my code under storing from the appvar to lists, every seventh (starting with the first) DATA slot represents the price for the land (hence PrintUInt(L1(3*7*ICUR))). Also when the number is 0, that means that it is not a land (chance, go, etc.):
Code:
[i]MONOPOLY
[i]"CCCCCCCCCCCCCCCC3333333CCCCCCCCC3BBBBB3CCCCCCCCC3B3B3B3CCCCCCCCC3BBBBB3CCCCCCCCC3B3B3B3CCCCCCCCC3BBBBB3CCCCCCCCC3333333CCCCCCCCCCCCCCCCCC3333333CCCCCCCCC3BBBBB3CCCCCCCCC3B3BBB3CCCCCCCCC3BBBBB3CCCCCCCCC3BBB3B3CCCCCCCCC3BBBBB3CCCCCCCCC3333333CCCCCCCCCCCCCCCC"
[i]CE Monopoly
"Go Mediterranean Avenue Community Chest Baltic Avenue Income Tax Reading Railroad Oriental Avenue Chance Vermont Avenue Conneticut Avenue Just Visiting In JailSt. Charles Place Electric Company States Avenue Virginia Avenue Pennsylvania RailroadSt. James Place Community Chest Tennessee Avenue New York Avenue Free Parking Kentucky Avenue Chance Indiana Avenue Illinois Avenue B. and O. Railroad Atlantic Avenue Ventnor Avenue Water Works Marvin Gardens Go To Jail Pacific Avenue North Carolina AvenueCommunity Chest Pennsylvania Avenue Short Line (Railroad)Chance Park Place Luxury Tax Boardwalk "->Str5
" Costs 60 Costs 60 Pay 200Costs 200Costs 100 Costs 100Costs 120 Costs 140Costs 150Costs 140Costs 160Costs 200Costs 180 Costs 180Costs 200 Costs 220 Costs 220Costs 240Costs 200Costs 260Costs 260Costs 150Costs 280 Costs 300Costs 300 Costs 320Costs 200 Costs 350Pay 75 Costs 400"->Str6
Begin
Lbl MAINM
0->CLOOP+3->TEXTH+1->LCHAR
"CE Monopoly->Str0
"Play->Str1
"Reset->Str2
"Credits->Str3
"Quit->Str4
Lbl CLOOP
1->CUR
SetTextFGColor(0
FillScreen(255
While 1
SetTextScale(TEXTH,TEXTH+1
PrintStringXY(Str0,1,1
SetTextScale(2,3
If CUR=1
SetTextFGColor(224
End
PrintStringXY(Str1,25,50
SetTextFGColor(0
If CUR=2
SetTextFGColor(224
End
PrintStringXY(Str2,25,75
SetTextFGColor(0
If LCHAR>2
If CUR=3
SetTextFGColor(224
End
PrintStringXY(Str3,25,100
SetTextFGColor(0
If LCHAR>3
If CUR=4
SetTextFGColor(224
End
PrintStringXY(Str4,25,125
SetTextFGColor(0
End
End
SetColor(0
Rectangle(4,(CUR+1)*25+2,16,16
Rectangle(8,(CUR+1)*25+5,2,2
Rectangle(14,(CUR+1)*25+13,2,2
Repeat not(KEY)=0
getKey->KEY
End
SetColor(255
FillRectangle(4,(CUR+1)*25+2,16,16
CUR-(KEY=4 and CUR!=1)+(KEY=1 and CUR!=LCHAR)->CUR
If KEY=54 or KEY=9
ReturnIf CLOOP=1
If CUR=1
Goto PLAY
End
If CUR=2
Goto RES
End
If CUR=3
Goto CRED
End
If CUR=4
Goto END
End
End
End
Lbl CRED
Goto MAINM
Lbl RES
CloseAll
1->CLOOP+1->LCHAR->TEXTH
"Erase Current Game?->Str0
"No->Str1
"Yes->Str2
Call CLOOP
0->CLOOP
If CUR=2
CloseAll
Open("Monopoly","r+->A
Delete("Monopoly
Close(A
End
Goto MAINM
Lbl PLAY
Alloc(975->DATA
CloseAll
If not(Open("Monopoly","r+
Open("Monopoly","w+"->A
Data(3,0,0,0,0,0,0,0,60,2,10,30,90,160,250,0,0,0,0,0,0,0,60,4,20,60,180,320,450,0,0,0,0,0,0,0,200,0,0,0,0,0,0,100,6,30,90,270,400,550,0,0,0,0,0,0,0,100,6,30,90,270,400,550,120,8,40,100,350,450,600,0,0,0,0,0,0,0,140,10,50,150,450,625,750,150,0,0,0,0,0,0,140,10,50,150,450,625,750,160,12,60,180,500,700,900,200,0,0,0,0,0,0,180,14,70,200,550,750,950,0,0,0,0,0,0,0,180,14,70,200,550,750,950,200,16,80,220,600,800,1000,0,0,0,0,0,0,0,220,18,90,250,700,875,1050,0,0,0,0,0,0,0,220,18,90,250,700,875,1050,240,20,100,300,750,925,1100,200,0,0,0,0,0,0,260,22,110,330,800,975,1150,260,22,110,330,800,975,1150,150,0,0,0,0,0,0,280,24,120,360,850,1025,1200,0,0,0,0,0,0,0,300,26,130,390,900,1100,1275,300,26,130,390,900,1100,1275,0,0,0,0,0,0,0,320,28,150,450,1000,1200,1400,200,0,0,0,0,0,0,0,0,0,0,0,0,0,350,35,175,500,1100,1300,1500,0,0,0,0,0,0,0,400,50,200,600,1400,1700,2000,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,0,1500,1500->DATA
Write(DATA,975,1,A
End
If Open("Monopoly","r+"->A
Read(DATA,975,1,A
End
Copy(L2,DATA,840
Copy(L1,DATA+840,135
Lbl REROLL
For(Z,1,10
FillScreen(255
SetTextScale(2,2
SetTextFGColor(0
PrintStringXY("YOUR ROLL",1,1
PrintStringXY("CPU'S ROLL",160,1
If Z=1
Pause 500
End
SetTextFGColor(222
1+remainder(rand,6)->A
1+remainder(rand,6)->B
A+B->ROLLA
1+remainder(rand,6)->A
1+remainder(rand,6)->B
A+B->ROLLB
SetTextXY(1,30
PrintUInt(ROLLA,2
SetTextXY(160,30
PrintUInt(ROLLB,2
Pause 50
End
Pause 1000
SetTextFGColor(0
SetTextScale(1,2
If ROLLA>ROLLB
PrintStringXY("You go first.",1,70
1->{L1+129
End
If ROLLA<ROLLB
PrintStringXY("CPU goes first.",1,70
2->{L1+129
End
If ROLLA=ROLLB
PrintStringXY("Tie. Roll Again.",1,70
PrintStringXY("(Press [2nd])",1,100
Repeat KEY=54
getKey->KEY
End
Goto REROLL
End
PrintStringXY("(Press Any Key)",1,100
Repeat not(KEY)=0
getKey->KEY
End
Lbl START
AsmComp(GRAPHICS
Lbl SAVE
Copy(DATA,L2,840
Copy(DATA+840,L1,135
CloseAll
Open("Monopoly","w"->A
Write(DATA,975,1,A
SetArchiveStatus(1,A
Close(A
Lbl END
det(1
Code:
[i]GRAPHIC
0->ICUR+205->XCUR->YCUR
[i]Begin
FillScreen(255
SetTextScale(1,1
Lbl DBOARD
SetColor(0
For(Z,0,10
Rectangle(5,5+(Z*20),20,20
Rectangle(205,5+(Z*20),20,20
Rectangle(5+(Z*20),5,20,20
Rectangle(5+(Z*20),205,20,20
End
SetColor(40
FillRectangle(186,206,18,5
FillRectangle(146,206,18,5
SetColor(117
FillRectangle(86,206,18,5
FillRectangle(46,206,18,5
FillRectangle(26,206,18,5
SetColor(136
FillRectangle(19,186,5,18
FillRectangle(19,146,5,18
FillRectangle(19,126,5,18
SetColor(226
FillRectangle(19,86,5,18
FillRectangle(19,46,5,18
FillRectangle(19,26,5,18
SetColor(224
FillRectangle(26,19,18,5
FillRectangle(66,19,18,5
FillRectangle(86,19,18,5
SetColor(230
FillRectangle(126,19,18,5
FillRectangle(146,19,18,5
FillRectangle(186,19,18,5
SetColor(7
FillRectangle(206,26,5,18
FillRectangle(206,46,5,18
FillRectangle(206,86,5,18
SetColor(17
FillRectangle(206,146,5,18
FillRectangle(206,186,5,18
SetColor(224
SetTextFGColor(224
PrintStringXY("GO",208,208
SetTextXY(208,216
PrintChar(27
HorizLine(208,219,14
Repeat KEY=15 or KEY=40
getKey->KEY
End
If KEY=15
Goto END
End
If KEY=40
While 1
SetColor(224
Rectangle(XCUR,YCUR,20,20
SetColor(0
SetTextFGColor(0
sub(Str5,ICUR*21,21->Str0
PrintStringXY(Str0,1,230
sub(Str6,ICUR*12,12->Str0
PrintStringXY(Str0,175,230
If ICUR=4 or ICUR=38
SetTextXY(208,230
PrintChar(36
Else
SetTextXY(217,230
PrintChar(36
End
If ICUR=2 or ICUR=7 or ICUR=17 or ICUR=22 or ICUR=33 or ICUR=36
SetColor(255
FillRectangle(208,230,25,10
SetColor(0
PrintStringXY("Draw Card",175,230
End
If remainder(ICUR,10)=0
SetColor(255
FillRectangle(208,230,25,10
SetColor(0
End
AsmComp(CARD
Repeat (KEY>0 and KEY<5) or KEY=40
getKey->KEY
End
Rectangle(XCUR,YCUR,20,20
SetColor(255
FillRectangle(1,230,315,10
FillRectangle(26,26,178,178
SetColor(0
If KEY=40
Goto DBOARD
End
If KEY=2 and (YCUR=5 or YCUR=205) and XCUR>5
XCUR-20->XCUR
If YCUR=205
ICUR+1->ICUR
Else
ICUR-1->ICUR
End
End
If KEY=3 and (YCUR=5 or YCUR=205) and XCUR<205
XCUR+20->XCUR
If YCUR=205
ICUR-1->ICUR
Else
ICUR+1->ICUR
End
End
If KEY=4 and (XCUR=5 or XCUR=205) and YCUR>5
YCUR-20->YCUR
If XCUR=5
ICUR+1->ICUR
Else
If ICUR=0
39->ICUR
Else
ICUR-1->ICUR
End
End
End
If KEY=1 and (XCUR=5 or XCUR=205) and YCUR<205
YCUR+20->YCUR
If XCUR=5
ICUR-1->ICUR
Else
ICUR+1->ICUR
If ICUR=40
0->ICUR
End
End
End
End
End
Lbl END
[i]det(1
Code:
det(21,0
det(74,1,2
For(DPOS,27,127,20
det(19,135,DPOS
det(14,36
End
det(18,"RENT",27,27
det(18,"w/ 1 House",27,47
det(18,"w/ 2 Houses",27,67
det(18,"w/ 3 Houses",27,87
det(18,"w/ 4 Houses",27,107
det(18,"w/ HOTEL",27,127
det(19,150,27
det(16,{L2+ICUR*21},4
det(74,1,1