Listing 6. Source code for the program named Alice0175e in Alice Style display format.

Alice0175e's Code

Created by: Dick Baldwin

world

Events

When the world starts
Do:
world.main


Methods

  world.main ( )
    rowLim = 3 , colLim = 5 , rowData = , product = 0
       // Copyright 2007, R.G.Baldwin
  // Illustrates nested for loops.
  Loop rowLim times times
       Loop colLim times times
       // Compute product of row and column.
  product set value to ( ( index * index ) )
  // Append product onto print line.
  rowData set value to ( rowData joined with ( product as a string ) )
  // Append column separator (space character) to print line.
  rowData set value to ( rowData joined with )
  // Perform another test in the inner loop.
  // Display the row data.
  print rowData
  // Clear the row data.
  rowData set value to
  // Perform another test in the outer loop.