
/****      Fran's proposal      *****/
     if(str == "prizes fran") {
     write("     ----------------------------------------------------------\n"+
           "    |      "+HIR+"       M A S T E R M I N D   P R I Z E S"+NORM+"            |\n"+
           "    |  "+HIW+"                         experience / coins given "+NORM+"      |\n"+
           "    | "+HIW+"number is guessed in  "+HIR+"easy         "+HIC+"medium       "+HIY+"tough"+NORM+"    |\n"+ 
           "    | "+HIW+" one   attempt  ->  "+HIR+"8      2     "+HIC+"16      4     "+HIY+"32    8"+NORM+"   |\n"+
           "    | "+HIW+" two   attempts ->  "+HIR+"4      1      "+HIC+"8      2     "+HIY+"16    4"+NORM+"   |\n"+
           "    | "+HIW+" three attempts ->  "+HIR+"2      .5     "+HIC+"4      1      "+HIY+"8    2"+NORM+"   |\n"+
           "    | "+HIW+" four  attempts ->  "+HIR+"1      .2     "+HIC+"2      .5     "+HIY+"6    1.5"+NORM+" |\n"+
           "    | "+HIW+" five  attempts ->  "+HIR+".5     .1     "+HIC+"1      .2     "+HIY+"4    1"+NORM+"   |\n"+
           "    | "+HIW+" six   attempts ->  "+HIR+"0      0      "+HIC+".5     .1     "+HIY+"3    .8"+NORM+"  |\n"+
           "    | "+HIW+" seven attempts ->  "+HIR+"-.5   -.5     "+HIC+"0      0      "+HIY+"2    .5"+NORM+"  |\n"+
           "    | "+HIW+" eight attempts ->  "+HIR+"-1    -1      "+HIC+"-.5   -.5     "+HIY+"1    .2"+NORM+"  |\n"+
           "    | "+HIW+" nine  attempts ->  "+HIR+"-1.1  -1.1    "+HIC+"-1    -1      "+HIY+".5   .1 "+NORM+" |\n"+
           "    | "+HIW+" ten   attempts ->  "+HIR+"-1.2  -1.2    "+HIC+"-1.2  -1.2    "+HIY+"0    0"+NORM+"   |\n"+
           "    |  "+HIY+"Any further attempt after the tenth will result in "+NORM+"     |\n"+
           "    |  "+HIY+"a further loss of 0.2 exp and 0.2 coins."+NORM+"                |\n"+
           "    |  "+HIW+"                                                     "+NORM+"   |\n"+
           "    |  "+HIC+"When the player guesses the number, the whole exp/coins"+NORM+" |\n"+
           "    |  "+HIC+"will be reimbursed, but the only small .5 coins fee."+NORM+"    |\n"+
           "    |  "+HIW+"                                                     "+NORM+"   |\n"+
           "    |  "+HIW+"                  (all figures are given in thousands)"+NORM+"  |\n"+
           "     ----------------------------------------------------------\n");
     return 1; }

/****      Wocket's proposal      *****/
     if(str == "prizes wocket") {
     write("     ----------------------------------------------------------\n"+
           "    |      "+HIR+"       M A S T E R M I N D   P R I Z E S"+NORM+"            |\n"+
           "    |  "+HIW+"                             experience given "+NORM+"          |\n"+
           "    | "+HIW+" number is guessed    "+HIR+"easy        "+HIC+"medium       "+HIY+"tough"+NORM+"     |\n"+ 
           "    | "+HIW+" in less than                                         "+NORM+"   |\n"+
           "    | "+HIW+" five  attempts  ->  "+HIR+" 1000"+NORM+"                               |\n"+
           "    | "+HIW+" six   attempts  ->                "+HIC+"3000"+NORM+"                  |\n"+
           "    | "+HIW+" seven attempts  ->                            "+HIY+"6000 "+NORM+"     |\n"+
           "    |  "+HIW+"                                                     "+NORM+"   |\n"+
           "    |  "+HIY+"After those number of attempts, the game is over. "+NORM+"      |\n"+
           "     ----------------------------------------------------------\n");
     return 1; }

/****      Wocket's proposal, modified by fran     *****/
     if(str == "prizes fran 2") {
     write("     ----------------------------------------------------------\n"+
           "    |      "+HIR+"       M A S T E R M I N D   P R I Z E S"+NORM+"            |\n"+
           "    |  "+HIW+"                             experience given "+NORM+"          |\n"+
           "    | "+HIW+" number is guessed     "+HIR+"easy         "+HIC+"medium       "+HIY+"tough"+NORM+"   |\n"+ 
           "    | "+HIW+" in less than                                         "+NORM+"   |\n"+
           "    | "+HIR+" five  attempts  ->  "+HIR+"1.5 x bet"+NORM+"                           |\n"+
           "    | "+HIC+" six   attempts  ->                "+HIC+"4 x bet"+NORM+"               |\n"+
           "    | "+HIY+" seven attempts  ->                             "+HIY+"8 x bet"+NORM+"  |\n"+
           "    |  "+HIW+"                                                     "+NORM+"   |\n"+
           "    |  "+HIM+"'bet' is the amount of coins a player wants "+NORM+"            |\n"+
           "    |  "+HIM+"to play with.  The player can choose 500, "+NORM+"              |\n"+
           "    |  "+HIM+"1000, 2000 coins to bet.                             "+NORM+"   |\n"+
           "    |  "+HIW+"                                                     "+NORM+"   |\n"+
           "    |  "+HIC+"After those number of attempts, the game is over. "+NORM+"      |\n"+
           "     ----------------------------------------------------------\n");
     return 1; }
/**********************comments********************
1. As you can see, there are three proposals, with different rewards.
2. My proposal #1: looks too much complicated.
3. Wocket's proposal: did i understood it well?
4. My proposal #2: it is like Wocket's but has also the possibility of choosing
  the amount of the bet.  I think it is cool, it adds some more pepper.
5. The break even points:  my statistics are as follows:
 easy mastermind:  54 games were played, they were solved in:
  number of tries        3   4   5   6   7   8   9   10
  number of occurrence   4  13  21   8   6   1   1    0
 medium mastermind:  47 games were played, they were solved in:
  number of tries        3   4   5   6   7   8   9   10
  number of occurrence   0   5  10  10   6   6   7    3
 tough mastermind:  11 games were played, they were solved in:
  number of tries        3   4   5   6   7   8   9   10
  number of occurrence   0   0   1   3   4   0   2    1
                        easy         medium       tough
  break even point   =     4             5           6
  number of wins     =    17            15           4
  number of losses   =    37            32           7
  win/loss ratio     =   .46           .47         .57
  total coins payed  = 27000         23500        5500 
  total exp earned   = 12750         30000       16000  
         It looks fair even though it isnt for sure useable for an exp run.
         Matter of fact, consider that basically you can make one game per minute,
         (something less for the easy one, something more for the medium one,
          much more for the tough one).
         Eventually, the exp gain could be increased a bit (hmmm, maybe about 20%?).        
6. Tough mastermind has some statistics now, and i think its threshold might be lowered to 6.
   We can eventually change its figures after a start up period.
6b.Since the win/loss ratio is almost the same, most players would go for the tough one,
   because it costs the same and gives more reward (even though it is much tougher).
   So, i could think of an increased cost acordingly: easy 500, medium 1000, tough 2000.
   Or something. Lets think about this. 
7. In conclusion: i would use my proposal #2 (eventually modified in the figures).
8. I wont be here during the Easter holyday.  We can settle the final version
when i will come back, hope you like this game  :) 

thank you

fran
**********************end coments********************/


read_book(str) {
     if (!str) {notify_fail("Read what?\n");return 0;}
     if(str == "flier") {
      write("The flier contains several info you can have:\n"+
            "You can:  'read rules'         'read syntax'          \n"+
            "          'read levels'        'read prizes' \n"+
            "          'read example 1'     'read example 2'       'read example 3'\n");
     return 1;}
     if(str == "rules") {
     write("     ----------------------------------------------------------\n"+
           "    |              "+HIR+"M A S T E R M I N D   R U L E S"+NORM+"             |\n"+
           "    |  "+HIW+"The goal of the game is to guess a predefined number"+NORM+"    |\n"+
           "    |  "+HIW+"within as few attempts as possible.  The number is"+NORM+"      |\n"+
           "    |  "+HIW+"made by some different digits, in the range 1 to 9."+NORM+"     |\n"+
           "    |  "+HIW+"Two digits will never be the same in the solution. "+NORM+"     |\n"+
           "    |  "+HIW+"                                                      "+NORM+"  |\n"+
           "    |  "+HIW+"The number of digits in the number to guess are chosen"+NORM+"  |\n"+
           "    |  "+HIW+"by the player and will result in an easy, medium or "+NORM+"    |\n"+
           "    |  "+HIW+"tough game.                                          "+NORM+"   |\n"+
           "    |  "+HIW+"                                                      "+NORM+"  |\n"+
           "    |  "+HIW+"A prize will be rewarded or a penalty will be applied"+NORM+"   |\n"+
           "    |  "+HIW+"according to the number of tries needed to solve the"+NORM+"    |\n"+
           "    |  "+HIW+"game and according to the difficulty of the game."+NORM+"       |\n"+
           "     ----------------------------------------------------------\n");
     return 1; }

     if(str == "levels") {
     write("     ----------------------------------------------------------\n"+
           "    |              "+HIR+"M A S T E R M I N D   L E V E L S "+NORM+"          |\n"+
           "    |    "+HIW+"The player can choose between three levels."+NORM+"           |\n"+
           "    |    "+HIW+"                                                      "+NORM+"|\n"+
           "    |    "+HIY+"In level easy,   there are three digits to guess."+NORM+"     |\n"+
           "    |    "+HIY+"In level medium, there are four digits to guess."+NORM+"      |\n"+
           "    |    "+HIY+"In level tough,  there are five digits to guess."+NORM+"      |\n"+
           "    |    "+HIW+"                                              "+NORM+"        |\n"+
           "    |    "+HIC+"Higher the level, higher the prizes!            "+NORM+"      |\n"+
           "     ----------------------------------------------------------\n");
     return 1; }
     if(str == "example 1") {
     write("     ----------------------------------------------------------\n"+
           "    |          "+HIR+"M A S T E R M I N D   E X A M P L E  #1 "+NORM+"        |\n"+
           "    | "+HIB+" The number to guess is 9427."+NORM+"                            |\n"+
           "    | "+HIW+" Your try: 1234 -> The 1 is not in the number to guess. "+NORM+" |\n"+
           "    | "+HIW+"                   The 2 is in the number to guess. "+NORM+"     |\n"+
           "    | "+HIW+"                   The 3 is not in the number to guess. "+NORM+" |\n"+
           "    | "+HIW+"                   The 4 is in the number to guess. "+NORM+"     |\n"+
           "    | "+HIY+"            The game master will say: 2 out_of_place."+NORM+"    |\n"+
           "    | "+HIW+"                                                      "+NORM+"   |\n"+
           "    | "+HIW+" Your try: 1475 -> The 1 is not in the number to guess."+NORM+"  |\n"+
           "    | "+HIW+"                   The 4 is in the number to guess and "+NORM+"  |\n"+
           "    | "+HIW+"                      in the correct position."+NORM+"           |\n"+
           "    | "+HIW+"                   The 7 is in the number to guess but"+NORM+"   |\n"+
           "    | "+HIW+"                      not in the correct position."+NORM+"       |\n"+
           "    | "+HIW+"                   The 5 is not in the number to guess. "+NORM+" |\n"+
           "    | "+HIY+"            The game master will say: 1 in_place"+NORM+"         |\n"+
           "    | "+HIY+"                                      1 out_of_place."+NORM+"    |\n"+
           "     ----------------------------------------------------------\n");
     return 1; }
     if(str == "example 2") {
     write("     ----------------------------------------------------------\n"+
           "    |          "+HIR+"M A S T E R M I N D   E X A M P L E  #2 "+NORM+"        |\n"+
           "    | "+HIB+" The number to guess is 9427."+NORM+"                            |\n"+
           "    | "+HIW+" Your try: 2445 -> The 2 is in the number to guess but "+NORM+"  |\n"+
           "    | "+HIW+"                      not in the correct position."+NORM+"       |\n"+
           "    | "+HIW+"                   The 4 is in the number to guess and "+NORM+"  |\n"+
           "    | "+HIW+"                      in the correct position."+NORM+"           |\n"+
           "    | "+HIW+"                   The 4 is in the number to guess and "+NORM+"  |\n"+
           "    | "+HIW+"                      not in the correct position."+NORM+"       |\n"+
           "    | "+HIW+"                   The 5 is not in the number to guess. "+NORM+" |\n"+
           "    | "+HIY+"            The game master will say: 1 in_place"+NORM+"         |\n"+
           "    | "+HIY+"                                      2 out_of_place."+NORM+"    |\n"+
           "    | "+HIW+"                                                      "+NORM+"   |\n"+
           "    | "+HIG+" You might also type in a guess with repeated digits."+NORM+"    |\n"+
           "    | "+HIG+" But, beware, using twice the same digit in your guess"+NORM+"   |\n"+
           "    | "+HIG+" might me helpful yet might be confusing."+NORM+"                |\n"+
           "     ------------------------------------------------------------\n");
     return 1; }
     
     if(str == "example 3") {
     write("     ----------------------------------------------------------\n"+
           "    |          "+HIR+"M A S T E R M I N D   E X A M P L E  #3"+NORM+"         |\n"+
           "    | "+HIB+" The number to guess is 9427."+NORM+"                            |\n"+
           "    | "+HIW+" your try: 1234 -> two numbers are out of position"+NORM+"       |\n"+
           "    | "+HIW+" your try: 1475 -> one in the right position, one out"+NORM+"    |\n"+
           "    | "+HIW+" your try: 9471 -> two in the right position, one out"+NORM+"    |\n"+
           "    | "+HIW+" your try: 4792 -> four numbers out of position"+NORM+"          |\n"+
           "    | "+HIW+" your try: 9427 -> you won!                              "+NORM+"|\n"+
           "    | "+HIW+"                                                      "+NORM+"   |\n"+
           "    | "+HIG+" How it will be displayed to you:                     "+NORM+"   |\n"+
           "    | "+HIY+" Attempt #1  Your guess -> 1234   in = 0  out = 2    "+NORM+"    |\n"+
           "    | "+HIY+" Attempt #2  Your guess -> 1475   in = 1  out = 1    "+NORM+"    |\n"+
           "    | "+HIY+" Attempt #3  Your guess -> 9471   in = 2  out = 1    "+NORM+"    |\n"+
           "    | "+HIY+" Attempt #4  Your guess -> 4792   in = 0  out = 4    "+NORM+"    |\n"+
           "    | "+HIY+" Attempt #5  Your guess -> 9427   in = 4  out = 0    "+NORM+"    |\n"+
           "    | "+HIW+" You solved the mastermind game!                        "+NORM+" |\n"+
           "     ----------------------------------------------------------\n");
     return 1; }

     if(str == "syntax") {
     write("     ----------------------------------------------------------\n"+
           "    |              "+HIR+"M A S T E R M I N D   S Y N T A X"+NORM+"           |\n"+
           "    |     "+HIG+"To start a game:  mastermind easy <bet>"+NORM+"              |\n"+
           "    |     "+HIG+"                  mastermind medium <bet>"+NORM+"            |\n"+
           "    |     "+HIG+"                  mastermind tough <bet>"+NORM+"             |\n"+
           "    |     "+HIW+"                                        "+NORM+"             |\n"+
           "    |     "+HIW+"To review your previous guesses:  review"+NORM+"             |\n"+
           "    |     "+HIW+"                                        "+NORM+"             |\n"+
           "    |     "+HIY+"To abandon the game:  I suck"+NORM+"                         |\n"+
           "    |     "+HIW+"                                        "+NORM+"             |\n"+
           "    |     "+HIC+"To input your guess:  guess # # # # "+NORM+"                 |\n"+
           "    |     "+HIC+"(digits separated by spaces)"+NORM+"                         |\n"+
           "     ---------------------------------------------------------- \n");
     return 1; }
return 1;}

