  % Title "Ascii Character Set"
  % Animated
  % ScaleUp
 '% PlaceCentral
 '% AnchorCentral
  uses ConsoleG


  ==========
  sub main()
  ==========
  string s
  cls 0,.15,.2
  static float ang
  ang+=1  : if ang>=360 then ang-=360
  '
  'TITLE
  pushstate
  scale 2.,1.25
  'typeface=1
  printl "Ascii Character Set"
  popstate
  '
  if opening
    picked=65 'A'
  end if
  '
  'ASCII LISTING
  ==============
  int c,d,i
  PushState
    move 2,-3
    scale 1.5

    'ASCII TABLE
    ============
    pushstate
    c=0
    d=0
    for i=0 to 255
      pushstate
      if picked=i
        color 1,1,.5,1
      end if
      picklabel i
      print chr(i)
      popstate
      move 1
      c++
      if c=16 then 'NEW LINE
        popstate
        printl ""
        c=0
        d++
        if d=8 then 'UPPER LIST
          printl
          d=0
        end if
        pushstate
      end if
    next
    picklabel 0
    popstate
  popstate
  '
  if not pick
  pushstate
    if picked
      shading
      pushstate
        move 30,-12
        color 1,1,.5,1
        scale 3
        printl "0x"+hex(picked)
      popstate
      move 33,-25
      rotateY ang
      move -4
      scale 10
      color 1,1,1,1
      print3d chr(picked)
    end if
  popstate
  endif
  '
  end sub

  EndScript
