Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
Thank you PT_!

I know that there are still several things that programs in BASIC can do that ICE can't, namely Strings (E.g. Str1="3A"). You have conveniently eliminated this problem and I hope to include this in future programs. Smile
I don't understand why the Y position keeps getting higher (well technically lower, but higher on the screen), eventhough my var checks comes out as expected (which should make JUMP-1->JUMP as shown in the code).



Code:


[i]STICKMAN
0->JDRAW->JUMP->JUMPA->JUMPD->WALKD+10->WALK+90->X+70->Y
Begin
While KEY!=9
   Lbl DRAW
   FillScreen(255
   SetColor(171
   HorizLine_NoClip0,220,320
   SetColor(0
   Circle(X,Y,10
   VertLine_NoClip(X,Y+10,20
   Line_NoClip(X,Y+30,X-WALK,Y+50
   Line_NoClip(X,Y+30,X+WALK,Y+50
   Line_NoClip(X,Y+15,X-WALK,Y+35
   Line_NoClip(X,Y+15,X+WALK,Y+35
   ReturnIf JDRAW=1
   Repeat KEY=2 or KEY=3 or KEY=4 or KEY=9
      getKey->KEY
      If JUMPA=1   //This makes the character move automatically even if you aren't pressing anything
         Call JDRAW
         If JUMP=0
            0->JDRAW
         End
      End
   End
   If KEY=2 and X>10
      X-5->X
   End
   If KEY=3 and X<310
      X+5->X
   End
   If KEY=4
      1->JUMPA
   End
   If JUMPA=0
      WALK-(WALKD=0)+(WALKD=1)->WALK
      If WALK=0
         1->WALKD
      End
      If WALK=10
         0->WALKD
      End
   End
   
End
Lbl JDRAW
If JUMP<21 and JUMPD=0
   JUMP+1->JUMP
End
If JUMP>20 or JUMPD=1
   1->JUMPD
   JUMP-1->JUMP
   If JUMP=0
      0->JUMPA->JUMPD
   End
End

//Check Vars
ClrHome
Disp JUMP,JUMPD
Pause

//Interestingly enough, eventhough my check vars show that JUMPD becomes 1 when it hits 20, the Y position keeps getting higher eventhough I have the command "JUMP-1->JUMP"
Y-JUMP->Y
1->JDRAW
Call DRAW
Return
Lbl END
det(1
That is because JUMP goes from 1 to 20 and backwards, and you keep subtracting it from Y, so once you reach 0 again, Y is equal to 160-1-2-3...-20-19-18...-2-1=-240. However, since you use Line_NoClip, it seems like the character is moving up again (which is true but should be out of screen). Also, be sure to replace that While loop with a Repeat.
My calculator freezes and I'm not sure why.


Code:

[i]
[i]
[i]

//The spaces are so I can use sub() later on in my code
"INTRO TO ALGEBRA     ALGEBRAIC MATHEMATICSORDER OF OPERATIONS  NUMBER PROPERTIES    "->Str1

sum(0

Alloc(84->A
sum(2,'Str1',"w+",4->A
sum(4,Str1,84,1,A
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
They say there are no stupid questions, so...
When I use the "Input" command, it switches the screen to what you get when you run an ICE program without det(1. Am I doing anything wrong or is it a bug? Thanks in advance! Smile
No, the Input is for the homescreen, if you want something on the screen with the gfx (using det(1)), you need to make a custom input routine.
Legoman314 wrote:
They say there are no stupid questions, so...
When I use the "Input" command, it switches the screen to what you get when you run an ICE program without det(1. Am I doing anything wrong or is it a bug? Thanks in advance! Smile


I can PM you with a routine if you need one?
I wrote a really good custom input routine in hybrid basic before, It uses xLIBc, so if you aren't familiar with that, then you should get the sdk out, but I believe there is an equivalent command for all of the functions used available in ICE, so it should be relatively easy to translate to an ICE-usable format. You might also have to change the coordinates of where text and shapes appear to fit wherever you want them to. I really like this one because it allows the user to enter uppercase letters, lowercase letters and digits.

Code:
real(0,1,1
real(8,1,0
real(0,3,4,255
DelVar LDelVar M"0->Str3
Repeat K=105 and L
   Repeat max(K={105,45,15,31,23
      getKey->K
      real(7,9,8L,18,2,9,255
      If K>40 and K<94 and K!=44 and K!=45 and M!=2
      Then
         L+1->L
         Str3+sub("ABC  DEFGHIJKLMNOPQRSTUVWXYZabc  defghijklmnopqrstuvwxyz",K-5iPart(.1K+4)+28M,1->Str3
      End
      If K>71 and K<103 and M=2 and min(K!={75,81,85,91,95
      Then
         L+1->L
         Str3+sub("7894561230.",K-22-7int(.1K),1->Str3
      End
      Str3
      real(6,0,~8,19,0,0
      real(7,9,8L,18,2,9,107
   End
   If K=45:Then
      DelVar L"0->Str3
      real(7,9,0,16,160,14,255
   End
   If K=15
   Goto Q
   If K=31
   Then
      real(7,9,150,3,10,10,0
      remainder(M+1,3->M
      sub("Aa#",M+1,1
      real(6,0,150,3,255
   End
   If K=23 and L
   Then
      real(7,9,8L-8,18,15,9,255
      sub(Str3,1,L->Str3
      L-1->L
   End
End

For reference, here is what all the xLIBc commands that I used do

Code:
real(0,1,1) turns on half resolution mode
real(8,1,0) switches buffers
real(0,3,4,255) sets the background to white
real(7,9...) draws a filled rectangle
real(6,0...) displays the string in Ans

Here is the DCSE8 SDk that describes how all the commands and their arguments work
Is there a way to store multiple values to a list in one line in ICE, ie. {3,1,4,1,5}->L1? Thanks in advance!
Legoman314 wrote:
Is there a way to store multiple values to a list in one line in ICE, ie. {3,1,4,1,5}->L1? Thanks in advance!

Yep, the syntax for doing so is as follows:

Code:
CopyData(DESTINATION,SIZE,DATA1,DATA2,...)

Here is what your line would look like

Code:
CopyData(L1,1,3,1,4,1,5)

DESTINATION is the list, and SIZE is the number of bytes allocated for each element in the list, in this case, since all your numbers are under 255, we should be able to use only 1 byte.
However, since we used a size that is not 3-bytes, then the way you access the data in the list will have to be different (because 3 is the default)
Here is how you would do it:

Code:
*{L1+0} will access the first element
*{L1+1} will access the second element
and so on
TI84pceBasicPro wrote:
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



Interestingly enough, if I split the appvar in half, my program worked. Also for convience, since the price of a building never changes, I simply just went directly from Data(3,...,...,..) to Copy(L1,DATA,...)
Legoman314 wrote:
Is there a way to store multiple values to a list in one line in ICE, ie. {3,1,4,1,5}->L1? Thanks in advance!



Read this documentation on using ICE lists, and while your at it, you mine as well read the whole thing. Smile
I am writing a program, and I have a 'for(' loop, which goes from 0-10, but I want to store a value in a variable which goes from 0-5, then back to 0. This is easily accomplished with the Absolute value function, but ICE does not support that. Any ideas? Thanks in advance! Smile
You can try this:

Code:

For(A,0,5)
A->*{VAR+A}
A->*{VAR+A+6}
End


Or something similar. Hope this helps!
I have a menu in my program where you select a number using the left and right keys. Is there a way to make them scroll like to color select in the Cesium menu, where you need to hold a key for about .5 seconds before it starts repeating? Thanks in advance!
I am not positive, but I think Mateo has not modified the OS button repeat at all so just using the normal getKey methods should work. I would advise that using things like the below example will be faster:

Code:
While 1
If getkey(15)
somethin
End
End

If you use the above example, you are bound to have much faster key presses than the cesium color menu. However, if you use the below code, I believe it to maintain the OS mode better:

Code:
While 1
getKey->G
If G=15
somethin
End
End
Thanks a lot for your quick replies to my somewhat hard to understand questions! Wink
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 2 of 2
» All times are GMT - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement