8 BIT SOFTWARE
To: CCC From: L1M (Janny Looyenga) Subject: REMARKS
REM" I liked this program (Issue 39)
REM" Simple and addictive - GO ON!!
REM" Now I'll never forget how
REM" I DID THIS... ---------------------------------------Subject: MENU (********) A little snow in the Christmas Issue: Very nice <What do we get with Easter> EGGS??? ---------------------------------------Subject: TBI-00 That's really been a job for you Chris and quite readable, but some people do not read very well and they use the cursor-keys like they used to do in Mode 7... And what did I get... Maybe someday the pages fit too? ---------------------------------------From: 15A (Steven Flintham) Subject: K8M's power supply article Although I think I might have missed a few jokes in this, as I'm not too knowledgeable about electronics, I still thought this was an entertaining read. From: 15A (Steven Flintham) Subject: DFS commands article This was very good on the whole but I feel it was a little bit unfair to *COMPACT. I haven't used DFS much lately, as my BBC B is still not working properly, but in all the time I was using it I don't recall ever losing a file during a *COMPACT and I think backing the disc up before performing a *COMPACT is perhaps a bit over-cautious. Having said that, I suspect that if the disc has a bad sector on it and *COMPACT tries to move a file onto it then some corruption may occur (this has never happened to me, so I may not be correct), so I think verifying the disc first would be a good idea. From: K2K (Peter Davy) Program: LOTTER3 (on Issue no.40) This program by K8B counts up the numbers of 1's, 2's, 3's and so on produced as the computer repeatedly evaluates RND(49). I cannot see what application this has to the National Lottery but it is an interesting thing to do in its own right. On taking my customary peep at the program listing I noticed that it is quite long. I hope K8B doesn't mind that I have selected his program as the basis for a short programming lesson! All that tedious typing is a result of using the variables Y1, Y2, Y3, etc. in which to store how many 1's, 2's, 3's etc. have been generated. It would have been much better to use an array i.e. Y(1), Y(2), Y(3) etc. Lines 80 to 140, which initialise each of Y1 to Y49 to zero would be replaced by a simpe single line DIM Y(49). At a stroke this would make available 49 variables all set at zero. I am puzzled by lines 230 and 240. RND(1) gives a random number between 0 and 0.999999999 so V will never be 1 but what does it matter as execution will transfer to line 250 irrespective of the value of V? Lines 260 to 740 would be replaced by a single line Y(X)=Y(X)+1. Lines 750 to 810 print all 49 numbers on the screen display but only one of them has changed since the last time these lines were executed. It would be better to print only the one which has changed. Elsewhere on this disk is the program MODLOT3 which incorporates the above ideas. Line 40 establishes the array A( ) in which the 49 "numbers of numbers" will be stored. I decided to display the results in three columns to give maximum space for each number: 1 ......26 18 ......27 35 ......25
2 ......28 19 ......29 36 ......28
3 ......27 20 ......29 37 ......25
etc. etc. 15 ......29 32 ......26 49 ......26
16 ......28 33 ......34
17 ......27 34 ......35
The top line of the above table is on row 4 of the screen. Line 90 prints on the screen the numbers from 1 to 49. It uses the PROC getxandy to find the co-ordinates for each number printed and uses FNpad to put a blank space in front of numbers 1 to 9. CHR$130 causes print to be in green and CHR$135 causes the "numbers of numbers" to be be printed in white in due course. The main action takes place in line 110. RND(49) is repeatedly evaluated, the appropriate element of the A( ) array is incremented by 1 and this new value is printed in the right place on the screen using the PROC getxandy. FNpAd is used to put dots in front of the number to build up the total number of characters to 8.The 4 in TAB(x+4,y) is so that the "number of numbers" is printed beyond the CHR$135 left by line 90. As would be expected the new version runs faster than the old. On my M-128 the old program runs at about 160 values per minute while the new version runs more than 7 times as fast at about 1180 values per minute. It may well be common knowledge but I didn't know that SHIFT-CTRL provides a temporary program execution stopper. Thank you K8B! To: 999 (all members) From: K2K (Peter Davy) Subject: 3PM's Article in Issue no.40 on the Subject of Palindromes. Thank you 3PM for your learned analysis of the problem of finding palindromes which have palindromic squares and cubes. I hope that "clear thinking day" becomes a reality and that you write in again with your further deductions. In the meantime I have been running my program LAPPY2 on Issue 39 on my A-3000 which is much faster than a BBC-B or an M-128. First I ran the program as it is to the bitter end and showed that 2 000 1 000 2 is the highest 9 digit number which has a palindromic square (4 000 4 000 9 000 4 000 4). I have inserted spaces in these numbers to make their "palindromicity" more easily apparent. Next I changed line no. 20 to FOR D%=10 TO 15. The print-out showed that 2 00000000 2 is the highest ten digit number which has a palindromic square (4 00000000 8 00000000 4). For palindromes up to and including ten digits it follows that the ones which have a palindromic square are those which are predicted by 3PM's masterly analysis and there are none of those "fluke" ones. It would have been nice to leave the program running to find out if there are any "flukes" with the 11, 12, 13, 14 and 15 digit palindromes. However each time the number of digits increases by 1 the number of palindromes to be processed goes up by a factor of ten and the time taken goes up by a factor of rather more than ten. It would have taken too long! As second best I have run the program up to 14 digit palindromes but by juggling about with lines 20, 5010 and 7010 have skipped over the ranges where only "flukes" might exist. e.g. for 11 digit numbers I processed palindromes from 10000000001 to 1111111111 then skipped to 20000000002 and 20000100002 and then skipped to the12 digit 100000000001 and so on. All results are in accord with 3PM's conclusions. The highest 14 digit palindrome found to have a palindromic square is: 2 000000000000 2, its square is: 4 000000000000 8 000000000000 4 A more interesting one is: 11 0 11 0000 11 0 11 whose square is: 121 242 121 242 484 242 121 242 121 The highest 14 digit palindrome found to have a palindromic cube is: 11 0000000000 11 whose cube is: 1331 00000000 3993 00000000 3993 00000000 1331 Phew! To: 999 (all members) From: K2K (Peter Davy) Subject: Lottery Simulation on Issue no.40. Postscript. I have run the program (on my A-3000 for the extra speed) on the 8 weeks National Lottery figures 7 Jan to 25 Feb inclusive. I ran each week's figures twice using my own and my wife's birth dates as seeds. Usually I ran the program to 200,000 or more entries. I got no match6 jackpots! I got 2 match5+ results. The first was on 4 Feb. (1 7 37 38 42 46 bonus 20) using the seed 140428. The sequence 1 7 37 46 42 20 was generated as the 40,273rd. board. The second was on 25 Feb (5 8 10 18 31 33 bonus 28) using the seed 291126. The sequence 33 5 18 10 31 28 was generated as the 281,179th. board! Running the program brings home forcibly to the user just how slim the chance of winning a big prize is. Match5, match5+ and match6 results are so rare that it would not be sensible to calculate the apparent odds from the computer runs. On the other hand match3 and match4 results are quite common and it is interesting to compare the apparent odds with the theoretical figures which appear on the How to Play leaflet. DATE match3 match4 7 Jan 1 in 55 1 in 1006 7 Jan 1 in 57 1 in 1052 14 Jan 1 in 57 1 in 1174 14 Jan 1 in 56 1 in 1071 21 Jan 1 in 58 1 in 1045 21 Jan 1 in 58 1 in 1040 28 Jan 1 in 58 1 in 1100 28 Jan 1 in 56 1 in 1047 4 Feb 1 in 56 1 in 1044 4 Feb 1 in 56 1 in 1085 11 Feb 1 in 56 1 in 1016 11 Feb 1 in 57 1 in 1053 18 Feb 1 in 57 1 in 990 18 Feb 1 in 56 1 in 1127 25 Feb 1 in 57 1 in 1110 25 Feb 1 in 57 1 in 1154 The theoretical odds are 1 in 57 for match3 and 1 in 1033 for match4. It is often said that all possible combinations of numbers stand an equal chance of being drawn. However I'm pretty sure that most punters would consider an entry of 1 2 3 4 5 6 would be money down the drain as it would be less likely to happen. In fact 1 2 3 4 5 6 is just as likely to be a winning entry as any other combination of figures. You can seek confirmation of this by running my Simulation program and entering 1 2 3 4 5 6 as the winningsequence and 7 as the bonus number. You will find you do just as well with these numbers as with numbers which look more likely to happen. How much real money have I risked on the Lottery? Not a single pound! From: K2F (John Davis) Program: Lotter3 Wow! Forty-nine consecutive IF statements in Andy Brandon's lottery program in issue 40. These can all be eliminated by putting each new number in an array: DIMA%(49) R%=RND(49):A%(R%)=A%(R%)+1 Then, more interestingly, instead of reprinting all the numbers each time, just the new number can be printed, calculating its screen position from its array number (R%): PRINT TAB(((R%-1)MOD7)*4,((R%-1)DIV7)* 3+1);A%(R%) This saves a lot of effort, and the program will also now run fifteen timesquicker. From: 20G (Roy Dickens) Subject: A FEW COMMENTS 8-Bit intro. screens Our Ed. Chris reckons that we should have some more intro screens. I agree with him. How about having a look at the (now PD)'Acorn User' intro screens for a few ideas. Or juggle them about abit and use them. I suppose its OK now they are PD. The two that I put in was only Mode 7 with a bit of teletext graphics and bit of scrolling. OK it wasn't much but it was fun doing it and I got a prize! Lotter5 by Peter Davy (K2K) This was a very informative lottery program. I have not had a go on the lottery yet and after Peters progam I don't think I will! Dominoes by Stuart Angell (K8F) I have seen this type of program with snakes and caterpillars but it makes a nice change using dominoes. Membership List (Chris) Thanks for the membership list Chris. Very handy to check the ID. It looks a long list. I hope that they all send their fifty pence etc. every month to keep you nice and busy. From: K6X (Cluke) Subject: Digipics The cheetahs were superb on screen, the b/w version looking great when viewed from near or far, the colour version needing to be viewed from a distance to get the colours to blend to best effect. Only niggle is that I have not been able to get a decent b/w printout that does not reverse black for white, and distort the image making it narrower and longer. Has anyone managed to print it out so it looks good? If so PLEASE, PLEASE tell me how?