# # canola - canon canola 1614p emulator # Copyright (C) 2011 Peter Miller # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 3, as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . ; ---------- Card-Pocket-Begin ------------------------------------------- ; Title: Mastermind, by T. Croucher and A. Smyth ; Style: aus ; Disassemble: true ; ---------- Card-Pocket-End --------------------------------------------- ; ; "Parabola", vol. 12 (1976), no. 5, pp. 16-18 ; ; http://www.parabola.unsw.edu.au/vol12_no2/ ; http://www.parabola.unsw.edu.au/vol12_no2/vol12_no2_5.pdf ; ; ; Mastermind ; ; This game was described in Vol. 11 No. 3 where it was suggested that ; we might discuss the possibility of programming a calculator for ; playing the gamee. Since then, we have received three programmes: the ; first from Mr P. Sherley (a teacher at Riverstone High), the second ; fram Mr P. Cox of Wahruonga and the third from Mr T. Croucher and ; Mr A. Smyth (teachers at Blakehurst High). Although the first two ; programmes were very good, the example from Blakehurst High, for the ; Canon Canola 1614P with Printer (optional) is felt to be the simplest ; and most compact ard is printed below. (They as sent a programme ; which deals with repetitions but this is not given.) ; ; To use the programme, one person starts by entering a 4 digit number. ; The machine then separates the digits and disperses them to memories ; 5, 6, 7 and 8. The person trying to discover the number then enters ; a 4 diyit number. The machine separates and disperses the digits to ; memories 9 to 12, counts the Bulls, counts the Hits, and then prints ; (or displays) your score. The scoring system is: 10 for each Bull, 1 ; for each Hit, so a score of 12 means that you have 1 Bull and 2 Hits ; (and so one digit completely wrong). A digit will not be counted as a ; Bull and a Hit in any one guess. Thus the aim of the game is to score ; 40. We hope that you will enjoy playing Mastermind as much as we have ; at our school. ; ; ; Procedure: ; ; 1. With machine ON, mode LRN, printer Off, enter the programme either ; manua_1y or by punch cards. ; 2. With mode OPE (a) Press START ; (b) Enter 4 digit number ; (c) Press START ; 3. With printer ON (a) Enter Guessed number ; (b) Press START (Your guess will be printed). After ; a few seconds the machine gives your score. ; (c) If SCORE is less than 40, enter another guess. ; (If SCORE = 40 the machine returns to the ; beginning and waits for a new secret number.) ; ; Notes: ; ; 1. ; If your school has no print _ttact_ment then replace '.' in step ; 98 with SJ, and omit step 99. When the machine stops and displays ; your score, then press START and it will continue. ; 2. Instructions SUJ, SFJ, and SRJ cannot be entered manually: they ; must be entered hy a punch card. They are instructions "108", ; "109" and "110". ; FJ 1 ENT SM3 SUJ CM1 SM8 SUJ CM1 SM7 SUJ CM1 SM6 RM3 SM5 CI FJ 2 CM1 ENT SM3 SUJ CM1 SM12 SUJ CM1 SM11 SUJ CM1 SM10 RM3 SM9 ; check for bulls RM12 RM8 SUJ CM2 RM11 RM7 SUJ CM2 RM10 RM6 SUJ CM2 RM9 RM5 SUJ CM2 ; check for hits RM12 RM7 SUJ CM3 RM12 RM6 SUJ CM3 RM12 RM5 SUJ CM3 RM11 RM8 SUJ CM3 RM11 RM6 SUJ CM3 RM11 RM5 SUJ CM3 RM10 RM8 SUJ CM3 RM10 RM7 SUJ CM3 RM10 RM5 SUJ CM3 RM9 RM8 SUJ CM3 RM9 RM7 SUJ CM3 RM9 RM6 SUJ CM3 ; print the score RM1 PRINT FD 40 -= MJ 2 UJ 1 SFJ CM1 RM3 SM4 right SM3 x 10 -= M4 RM4 SRJ SFJ CM2 -= sqrt SC MJ 3 10 M1 FJ 3 SRJ SFJ CM3 -= sqrt SC MJ 4 1 M1 FJ 4 SRJ ; ; ; The Strategy: ; ; To our knowledge no mathematical analysis has yet been done to suggest ; the best strategy for Mastermind, so based on our experience of many ; games we would like to offer a strategy that we believe to be sound. ; ; First guess: Try any 4 digits. ; Second guess: Unless you had 4 Hits or better, try 4 different digits. ; Third guess: If you haven't had a total of 4 Hits (or better) then try ; the 2 remaining digits with 2 from previous guesses. ; Fourth guess: Based on the previous guesses determine the most likely ; result (that is the one that has most probabiIity) and ; assume it to be correct. ; Remaining guesses: Here you have to play as it goes, but pursue your ; assumption until it is proved right or wrong. If you do ; this you will either have finished or discovered a new ; possibility to foIlow. ; ; Finally, might we suggest that in most cases take the combination of digits ; that has the most possibilities. In most cases you should finish in 6 or ; maybe 7 guesses. ; ; The above strategy was also submitted by Mr T. Croucher. After playing the ; game for a while, some of our readers might like to try to suggest a better ; strategy.