version 1 by Aaron Reed

  • Home page
  • Beginning
  • Previous
  • Next

  • Section - Implementing Spin

    A thing can be spinnable. A thing is usually not spinnable.

    player-has-spin is a truth state that varies. player-disabled-spin is a truth state that varies.

    Spinning is an action applying to one visible thing. Understand "spin [something]" as spinning.

    Check spinning a not spinnable thing (this is the only spinnables can be spun rule): say "That's not something that can be spun. Type SPIN for a list of visible things that can be." instead.

    Check spinning when player-has-spin is false (this is the players without spin can't spin rule): say "You don't have spin." instead.

    Check spinning when player-disabled-spin is true (this is the players who have disabled spin can't use it rule): say "You've disabled spin for this game." instead.

    First carry out spinning (this is the process spinning rule):
        now noun is not spinnable;
        now player-has-spin is false.
    After spinning (this is the display results of spinning rule):
        try looking;
        say "(Spin [one of]returns[or]goes back[stopping] to me.)".

    To award spin for (item - a thing):
        if item is spinnable, gain spin;
        now item is not spinnable.

    To gain spin: (- gainSpin(); -).

    Include (-

    [ gainSpin ;
        if ( (+ player-has-spin +) == false && (+ player-disabled-spin +) == false)
            print "^(You reclaim spin.)^";
        (+ player-has-spin +) = true;