Interactive Parsing

version 3 by Jon Ingold

  • Home page
  • Beginning
  • Previous
  • Next



  • Chapter 2 - Suggesting Words

    Section 1 - Prioritised words

    Include (-

    Constant MAX_BOOST_WDS = 30;
    Global wds_boosted = 0;
    Array boost_wds --> MAX_BOOST_WDS;

    -) before "Parser.i6t".

    Table of Useful Words
    word name   
    "look"  
    "drop"  
    "close"  
    "attack"  


    When play begins:
        repeat through Table of Useful Words:
            prioritise word name entry;

    To prioritise (w - text):
        (- BoostWord({w}); -).

    Include (-



    [ BoostWord w;
        if (wds_boosted < MAX_BOOST_WDS)
        {
            boost_wds-->wds_boosted = w;
            wds_boosted++;
        }
        else
            print "[***ERROR: Tried to boost more than available number of words. Please up the limit.***]^";
    ];

    -).