Direkt zum Inhalt | Direkt zur Navigation

forum::für::umläute nicole pruckermayr & IOhannes m zmölnig

Sektionen
Benutzerspezifische Werkzeuge
Sie sind hier: Startseite Members IOhannes m zmölnig projects Drawing by Numbers listing
Artikelaktionen

listing

listing:

 1 rem ***************************
 2 rem *   Painting By Numbers   *
 3 rem ***************************
 4 rem *  (c) IOhannes m zmölnig *
 5 rem * materialschwund 17.3.05 *
 5 rem *      Gnu GPL v2.0       *
 6 rem ***************************
 10 cls:mode 0:border 0:randomize time
 20 gosub 420: ' initialize
 30 gosub 530: ' choose image
 40 gosub 580: ' draw figures
 50 move posX, posY
 60 ' main loop
 70 keyboard$=inkey$:joystick=joy(0)
 80 gosub 100
 90 goto 60
 100 'keyboard
 110 if keyboard$="" then goto 190
 120 if keyboard$=chr$(13) then gosub 530:' change the image
 130 for n=1 to len(keyboard$)
 140 k$=mid$(keyboard$, n, 1)
 150 if (k$<"0" or k$>"9") then goto 180:else color=val(k$)
 160 tempcol=3*color MOD 26:border tempcol:ink 12,tempcol
 170 next
 180 ' joystick
 190 if (joystick=0) then goto 320
 200 if (joystick and 1) then posY=posY+deltaY: 'up
 210 if (joystick and 2) then posY=posY-deltaY: 'down
 220 if (joystick and 4) then posX=posX-deltaX: 'left
 230 if (joystick and 8) then posX=posY+deltaY: 'right
 240 if posX<0 then posX=0
 250 if posX>sizeX then posX=sizeX
 260 if posY<0 then posY=0
 280 if posY>sizeY then posY=sizeY
 280 gosub 330:' delete cross
 290 move posX, posY
 300 if (joystick and 16) then gosub 370: 'fill
 310 gosub 330:' paint cross
 320 return
 330 ' cross hair
 340 mover 5,0:drawr -11,0,12,1
 350 mover 6,6:drawr 0,-11,12,1
 360 mover 0,5:return
 370 ' fill
 380 graphics pen 11
 390 fill color
 400 return
 410 ' initialize
 420 cls
 430 graphics pen 12,0
 440 color=0:sizeX=640:sizeY=400
 450 posX=sizeX/2:posY=sizeY/2
 460 deltaX=5:deltaX=5
 470 move 0,0:draw sizeX-1,0:draw sizeX-1,sizeY-1:draw 0,sizeY-1:draw 0,0
 480 move posX,posY
 490 gosub 330: 'initial cross
 500 for i=0 to 10:ink i,(3*i mod 26):next:ink 1,26:ink 11,26
 510 return
 520 ' choose an image
 530 if (int(rnd*100) mod 2)=0 then image=0:xoffset=170:yoffset=0:else image=1:xoffset=140:yoffset=0
 540 gosub 410:' initialize
 550 gosub 570:' redraw figures
 560 return
 570 draw some figures
 580 graphics pen 11
 590 if image=1 then restore 910:else restore 740
 600 read x
 610 col=1
 620 while x>-1
 630  read y
 640  move x+xoffset,y+yoffset
 650  read x
 660  while x>-1
 670   read y
 680   draw x+xoffset,y+yoffset,,0
 690   read x
 700  wend
 710 read x
 720 wend
 730 return
 740 ' Henry Matisse: Die Schnecke (1953)
 750 data 23,376,21,297,20,214,48,215,28,11,22,46,16,32,100,0,71,11,71,19,104,19,-1
 760 data 24,24,236,16,241,99,30,107,24,24,-1
 770 data 237,21,254,21,328,6,347,99,293,112,254,94,239,124,254,21,-1
 780 data 254,94,346,139,269,211,232,195,235,174,212,177,254,94,-1
 790 data 269,211,294,194,342,252,311,276,269,211,-1
 800 data 330,105,355,213,358,213,367,301,358,301,-1
 810 data 342,253,358,250,358,378,243,370,246,311,254,308,247,295,247,283,301,263,-1
 820 data 253,307,175,371,130,309,197,260,215,259,253,307,-1
 830 data 243,370,155,370,155,345,-1
 840 data 155,370,52,370,38,379,23,376,-1
 850 data 208,101,216,172,170,172,160,101,-1
 860 data 236,177,215,260,148,251,129,214,116,208,119,188,170,186,236,177,-1
 870 data 152,186,170,170,125,100,66,146,115,208,-1
 880 data 115,208,61,172,27,284,130,314,148,254,127,220,115,208,-1
 890 data 65,296,22,297,-1
 900 data -1
 910 ' Laszlo Moholy-Nagy: Konstruktion (1923)
 920 data 0,294,279,126,-1
 930 data 0,282,279,118,-1
 940 data 38,399,69,253,-1,72,240,87,169,-1,90,155,123,0,-1
 950 data 48,399,80,246,-1,82,235,95,171,-1,98,158,131,0,-1
 960 data 0,331,102,0,-1,0,321,99,0,-1
 970 data 0,132,136,187,-1,163,197,279,245,-1,0,120,137,175,-1,173,191,279,231,-1
 980 data 136,201,136,58,216,58,216,153,-1,216,164,216,290,136,290,136,211,-1
 990 data 164,186,168,96,244,99,243,139,-1,241,150,233,343,157,340,163,197,-1
 1000 data -1


Powered by Plone , Apache , Debian and algo.mur.at