main_templates5/bfc.scala
changeset 384 6e1237691307
parent 348 b5b6ed38c2f2
child 399 b17a98b0c52f
equal deleted inserted replaced
383:c02929f2647c 384:6e1237691307
    93 // memory at the current location to 0. In the compute3 and run3 functions
    93 // memory at the current location to 0. In the compute3 and run3 functions
    94 // below you implement this command by writing the number 0 to mem(mp), 
    94 // below you implement this command by writing the number 0 to mem(mp), 
    95 // that is write(mem, mp, 0). 
    95 // that is write(mem, mp, 0). 
    96 //
    96 //
    97 // The easiest way to modify a string in this way is to use the regular
    97 // The easiest way to modify a string in this way is to use the regular
    98 // expression """[^<>+-.,\[\]]""", which recognises everything that is 
    98 // expression """[^<>+-,\[\]@#*]""", which recognises everything that is 
    99 // not a bf-command and replace it by the empty string. Similarly the
    99 // not a bf-command and replace it by the empty string. Similarly the
   100 // regular expression """\[-\]""" finds all occurrences of [-] and 
   100 // regular expression """\[-\]""" finds all occurrences of [-] and 
   101 // by using the Scala method .replaceAll you can replace it with the 
   101 // by using the Scala method .replaceAll you can replace it with the 
   102 // string "0" standing for the new bf-command.
   102 // string "0" standing for the new bf-command.
   103 
   103