10 DEFFNS="SCRABLE" 12 REM Line 10 is neat! To save the program, type in SAVE FNS and it saves it to disc with the name given in quotes. Thanks to Jon (Ed). 13 14 REM A small program to choose 7 random letters for 4 players at scrabble. 15 19 20 MODE7 21 REM I find that putting in the modelike this is a neat way of getting the program to clear a lot of things in the computer. Don't know why! 22 23 REM I guess MODE 7 is kind of basic! 24 REM "SCRABBLE" 25 26 REM The scrabble bag has 100 letters in it. There are 26 letters in the alphabet and a blank (#) makes 27. Each letter in the alphabet has its own score so 27 scores as well. 27 28 REM See lines 600-610 for letters and scores. 29 30 REM Line 40 sets aside space for the letters,numbers of letters and scores 31 32 REM Does DIM mean the computer is so dim that it has to be TOLD to set the space aside?! 33 34 REM Or is it that they have been kind and given us dim humans a basic code word to do it?!! 39 40 DIMletter$(100),number(27),score(27) 41 43 44 REM Now we can make 3 numbered lists in this space. 45 46 REM To do this we can use a variable 1 to 100 and 1 to 27.FOR X=- TO - seems the best way 49 50 FORX=1TO100:READletter$(X):NEXT 52 FORX=1TO27:READnumber(X),score(X):NEXT 53 54 REM Lines 60 to 100 use a procedure 4 times to choose 7 letters for each player 55 56 REPEAT 59 60 FORP=1TO4 70 PROCchoose7 100 NEXT 110 PRINTTAB(2,18)"Press any key to go again. Escape to exit. LIST CTRLN RETURN to list program and read it." 120 IF GET 130 UNTIL FALSE 199 200 DEFPROCchoose7 210 FORX=1TO7 220 R=RND(100) 230 N=FNn(ASCletter$(R)) 234 IFnumber(N)=0GOTO220 240 PRINTTAB(X*3,P*4)letter$(R) 250 number(N)=number(N)-1 260 NEXT 290 ENDPROC 299 330 REMthe procedure above uses a loop of 7 to get 7 letters for the player lines 210 - 260 331 332 REM puts a random number between 1 and 100 into R line 220 333 334 REMturns it into a number from 1 to 27 at line 230 see FNn() 335 336 REMchecks to see if this letter is in the bag line 234 337 338 REM if not sends you back to random R again to get another one 339 340 REMprints the letter on screen 341 342 REMtakes one away from number(N) in the list holding the numbers of each letter. E.G. There are 9 A,s. number(1)=9.9-1=8. Now number(1) will be 8. and so on. 599 600 DATAA,A,A,A,A,A,A,A,A,B,B,C,C,D,D,D,D,E,E,E,E,E,E,E,E,E,E,E,E,F,F,G,G,G,H,H,I,I,I,I,I,I,I,I,I,J,K,L,L,L,L,M,M,N,N,N,N,N,N,O,O,O,O,O,O,O,O,P,P,Q,R,R,R,R,R,R,S,S,S,S,T,T,T,T,T,T,U,U,U,U,V,V,W,W,X,Y,Y,Z,#,# 610 DATA9,1,2,3,2,3,4,2,12,1,2,4,3,2,2,4,9,1,1,8,1,5,4,1,2,3,6,1,8,1,2,3,1,10,6,1,4,1,6,1,4,1,2,4,2,4,1,8,2,4,1,10,2,0 619 620 REM if you look at the DATA you can see the 100 letters in line 600 621 622 REM line 610 has the number of (A's) and its score value, then the number of B's and its score value etc etc to Z and the # which come last. 699 700 DEFFNn(N):IFN>64N=N-64 710 IFN=35N=27 720 =N 749 750 REM N=ASCletter$(R) this means that it converts the letter taken out of the bag into its ASC value A=65, B=66 etc. and puts this number into N. 751 752 REMthe FNn then first takes away 64 so that we have the numbers 1 to 26 for the letters of the alphabet 753 754 REMthen second, looks to see if the blank (#) has been chosen (ASC 35) if so changes it into 27 to fit in the numbered list.