PRINT "Taste 1=Farbtreppe 2=Raster 3=1+2 4=Kreis+2 5=Ende"
SLEEP:SLEEP
DEFINT a-z
LIBRARY "lib1/exec.library"
LIBRARY "lib1/intuition.library"
DECLARE FUNCTION allocmem& LIBRARY
DECLARE FUNCTION freemem& LIBRARY
DECLARE FUNCTION getprefs& LIBRARY
DECLARE FUNCTION setprefs& LIBRARY
SCREEN 2,358,290,3,1
WINDOW 2,,(0,0)-(335,276),15,2
speicher&=allocmem&(300,3)
IF speicher&=0 THEN END
 pref&=getprefs&(speicher&,300)
 POKE speicher&+118,240
 POKE speicher&+119,230
 dummy&=setprefs&(speicher&,300,0)
 PALETTE 0,0,0,0
 PALETTE 1,1,1,1
 PALETTE 2,1,1,0
 PALETTE 3,0,1,1
 PALETTE 4,0,1,0
 PALETTE 5,1,0,1
 PALETTE 6,1,0,0
 PALETTE 7,0,0,1

test:

  a$=INKEY$:IF a$="" THEN GOTO test
  a=VAL(a$)
  IF a<1 OR a>5 THEN GOTO test
  CLS
  ON a GOSUB treppe,raster,beides,kreis,ende
  GOTO test
           

ende:

  POKE speicher&+118,0
  POKE speicher&+119,0
  dummy&=setprefs&(speicher&,300,0)
  dummy&=freemem&(speicher&,300)
  WINDOW CLOSE 2
  SCREEN CLOSE 2
  LIBRARY CLOSE
  SYSTEM

treppe:

 LINE (0,0)-(41,276),1,bf
 LINE (41,0)-(82,276),2,bf
 LINE (82,0)-(123,276),3,bf
 LINE (123,0)-(164,276),4,bf
 LINE (164,0)-(205,276),5,bf
 LINE (205,0)-(246,276),6,bf
 LINE (246,0)-(287,276),7,bf
 LINE (287,0)-(328,276),0,bf
RETURN

raster:

 FOR t=0 TO 276 STEP 20
  LINE (0,t)-(335,t),1
 NEXT
 FOR t=0 TO 335 STEP 20
  LINE (t,0)-(t,276),1
 NEXT
RETURN

beides:
 GOSUB treppe
 GOSUB raster
 RETURN 
 
kreis:
  CIRCLE (167,138),120,1,,,1
  GOSUB raster
  RETURN           
