### Author Topic: Another Colour Select/Randomizer  (Read 354 times)

0 Members and 1 Guest are viewing this topic.

• Amiga 1200
• Posts: 260
• Karma: 24
• Hard players don't go home.
##### Another Colour Select/Randomizer
« on: April 24, 2018 »
D-Pad to select, Page Up to Randomize.

Instead of a 1+1/1-1 count, data has been used for chosen numbers.
In this program, there is 32, 16 and 8 counts, changed by the line - restore value*. * is 1, 2 or 3.

Code: [Select]
`restore RGBread setsdim Rset\$(sets)dim Rnos(sets)for a=1 to setsread Rset\$(a)read Rnos(a)next arestore values3read colsdim Rv(cols)dim R(cols)for a=1 to colsread Rv(a)next asel=3for a=1 to selR(a)=int(cols/2)next aopen window 640,512repeatsetdispbuf vmvm=1-vmsetdrawbuf vmclear windowc=peek("port1")if and(c,128)<>0 left=1if left=1 L=L+1if L>2 L=2if L=2 left=0if and(c,128)=0 L=0if and(c,32)<>0 right=1if right=1 R=R+1if R>2 R=2if R=2 right=0if and(c,32)=0 R=0if left=1 sel=sel-1if right=1 sel=sel+1if sel<1 sel=1if sel>sets sel=setsif and(c,16)<>0 up=1if up=1 U=U+1if U>2 U=2if U=2 up=0if and(c,16)=0 U=0if and(c,64)<>0 down=1if down=1 D=D+1if D>2 D=2if D=2 down=0if and(c,64)=0 D=0if and(c,1)<>0 slide=1if slide=1 S=S+1if S>2 S=2if S=2 slide=0if and(c,1)=0 S=0for a=1 to setsif sel=a then setrgb 1,256,128,0fill rectangle 75*a+150,138 to 75*a+(len(Rset\$(a))*10)+150,156endifif sel=a thensetrgb 1,0,128,0elsesetrgb 1,256,256,256endiftext 75*a+150,150,Rset\$(a)next afor a=1 to sets rem selif sel=a and up=1 R(a)=R(a)+1if sel=a and down=1 R(a)=R(a)-1if R(a)<1 R(a)=1if R(a)>cols R(a)=colsfor b=1 to colsif R(a)=b Rnos(a)=Rv(b)next bsetrgb 1,256,256,256text 75*a+150,165,str\$(Rnos(a))next aif slide=1 thenfor a=1 to selR(a)=int(ran(cols))+1next aendiffor a=1 to selsetrgb 1,Rnos(1),Rnos(2),Rnos(3)fill rectangle 200,200 to 450,450next auntil (1=0)label RGBdata 3data "RED",0data "GREEN",0data "BLUE",0label values1data 9data 0,32,64,96,128,160,192,224,256label values2data 16data 0,16,32,48,80,96,112,128,144data 160,176,192,208,224,240,256label values3data 31data 0,8,16,24,32,40,48,56,80,88data 96,104,112,120,128,136,144data 152,160,168,176,184,192,200data 208,216,224,232,240,248,256`
Have a Yahappy day.
I don't know what is wrong with the world - but I know how to fix it.

#### rain_storm

• Here comes the Rain