Original Parser

version 1 by Ron Newcomb

  • Home page
  • Beginning
  • Previous
  • Next



  • Chapter - Snippets

    [Although the idea is arguably implicit in I6, the formal concept of
    ``snippet'' is new in I7. A snippet is a value which represents a word
    range in the command most recently typed by the player. These words number
    consecutively upwards from 1, as noted above. The correspondence between
    $(w_1, w_2)$, the word range, and $V$, the number used to represent it as
    an I6 value, is:
    $$ V = 100w_1 + (w_2-w_1+1) $$
    so that the remainder mod 100 is the number of words in the range. We
    require that $1\leq w_1\leq w_2\leq N$, where $N$ is the number of words in
    the current player's command. The entire command is therefore represented by:
    $$ C = 100 + N $$]