//
// PLASMA DOESN'T REQUIRE UPPER CASE.
// HOWEVER, DUE TO THE NATURE OF THE
// APPLE ][ AND ][+, UPPER CASE WILL
// LOOK BEST ON ALL APPLE II COMPUTERS.
// IF YOU PRINT LOWER CASE TEXT ON AN
// APPLE ][ OR ][+ USING PUTS, IT WILL
// BE AUTOMATICALLY SHIFTED TO UPPER
// CASE.
//
// Here is the PLASMA version of
// Rod's Colors from the DOS System
// Master disk using the built-in call
// function to call ROM routines:
//
const showlores = $C056
const keyboard  = $C000
const keystrobe = $C010
byte  i, j, k, w, fmi, fmk, color

def textmode
  call($FB39, 0, 0, 0, 0)
  return home
end

def grmode
  call($FB40, 0, 0, 0, 0)
  ^showlores
  return home
end

def colors
  while 1
    for w = 3 to 50
      for i = 1 to 19
        for j = 0 to 19
          k = i + j
          color = (j * 3) / (i + 3) + i * w / 12
          fmi = 40 - i
          fmk = 40 - k
          call($F864, color, 0, 0,   0) //grcolor(color);
          call($F800, k,     0, i,   0) //grplot(i, k);
          call($F800, i,     0, k,   0) //grplot(k, i);
          call($F800, fmk,   0, fmi, 0) //grplot(fmi, fmk);
          call($F800, fmi,   0, fmk, 0) //grplot(fmk, fmi);
          call($F800, fmi,   0, k,   0) //grplot(k, fmi);
          call($F800, k,     0, fmi, 0) //grplot(fmi, k);
          call($F800, fmk,   0, i,   0) //grplot(i, fmk);
          call($F800, i,     0, fmk, 0) //grplot(fmk, i);
          if ^keyboard >= 128
            return ^keystrobe
          fin
        next
      next
    next
  loop
end


grmode
gotoxy(10,2) // X,Y offsets from the text window
puts("Press any key to exit.")
colors
textmode
puts("That's all, folks!")
done

This program skips the optional "()" on
parameter-less functions. You decide if
this is a style you prefer. Regardless,
be consistent in your source code.
