[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
LOGO-L> Xmas - The Gift of Life - Conway's +...
Gary P. Thompson II's post of the Quine Page, immediately put
me into nostalgia mode.
I love old and exotic compilers, interpreters, languages
etc.
Stocking Stuffer #1
A file I received a long time ago from a friend contained many
versions of Conway's Game of Life, written in a whole host of languages.
Since the problem can be described in 3 simple rules and most
implimentations are under 2 pages of source code, it's great for showing
students, of all ages, how the various computer languages differ, much
like dialects of a so-called natural language. I started to analyze them
from the point of view of cognitive complexity, but never finished it.
The various versions include 2 dialects of BASIC, 2 of C (one with a
different representational algorithm), FORTRAN, FORTH (one of my
favorities), LISP, PROLOG, and a few editor type languages.... Sorry, no
LOGO, yet! Perhaps one of you might want to either hack the LISP version
or do one from scratch, over the holidays....
I compressed the files, into a ZIP of 28K. email me if your
interested. If enough are, I can either post it or put it on my own
webpage
http://kncell.org.
Stocking Stuffer #2
A multi precision BASIC -
I do a lot with games, for analyzing cognitive styles, strengths and
weaknesses of people etc. One thing that always bugged me, was I wanted
to know how many possible games of solitaire could be dealt. Since my
first love was Mathematics, I knew the answer was 52! (52 factorial).
Having had brief affairs with number theory, cryptoanalysis etc, I've
known since I was a teen-ager that the answer was about 68 digits long.
35 Years in the computer industry, while it feds the kids, etc. didn't
help, and indeed frustrated me more. Almost every computer language out
there cuts out at 10-12 digits and goes to E-notation. But I wanted to
know exactly how many hands were possible!
Then I discovered UBASIC, a very small (120K executable!), program
that allowed 2400 digit accuracy! It took a 10 line program, to get the
answer I wanted (6 lines for the answer, + 4 lines to time it, and count
the number of digits in the answers).
For the curious, here it is:
10 print=print+"deckdat"
20 print date,time,time1000
22 clr time
25 for I=1 to 52
40 A=!(I)
50 S=str(A)
55 L=len(S)
60 print I;L-1;A
70 next I
80 print time1000
1997/ 6/27/ 11:04:51
131:04:51 39896451
1 1 1
2 1 2
3 1 6
4 2 24
5 3 120
6 3 720
7 4 5040
8 5 40320
9 6 362880
10 7 3628800
11 8 39916800
12 9 479001600
13 10 6227020800
14 11 87178291200
15 13 1307674368000
16 14 20922789888000
17 15 355687428096000
18 16 6402373705728000
19 18 121645100408832000
20 19 2432902008176640000
21 20 51090942171709440000
22 22 1124000727777607680000
23 23 25852016738884976640000
24 24 620448401733239439360000
25 26 15511210043330985984000000
26 27 403291461126605635584000000
27 29 10888869450418352160768000000
28 30 304888344611713860501504000000
29 31 8841761993739701954543616000000
30 33 265252859812191058636308480000000
31 34 8222838654177922817725562880000000
32 36 263130836933693530167218012160000000
33 37 8683317618811886495518194401280000000
34 39 295232799039604140847618609643520000000
35 41 10333147966386144929666651337523200000000
36 42 371993326789901217467999448150835200000000
37 44 13763753091226345046315979581580902400000000
38 45 523022617466601111760007224100074291200000000
39 47 20397882081197443358640281739902897356800000000
40 48 815915283247897734345611269596115894272000000000
41 50 33452526613163807108170062053440751665152000000000
42 52 1405006117752879898543142606244511569936384000000000
43 53 60415263063373835637355132068513997507264512000000000
44 55 2658271574788448768043625811014615890319638528000000000
45 57 119622220865480194561963161495657715064383733760000000000
46 58 5502622159812088949850305428800254892961651752960000000000
47 60 258623241511168180642964355153611979969197632389120000000000
48 62 12413915592536072670862289047373375038521486354677760000000000
49 63 608281864034267560872252163321295376887552831379210240000000000
50 65 30414093201713378043612608166064768844377641568960512000000000000
51 67 1551118753287382280224243016469303211063259720016986112000000000000
52 68 80658175170943878571660636856403766975289505440883277824000000000000
2651 milliseconds!
Enjoy!
Bob
"To get NEW Answers, you must ask NEW Questions!"
- Bob Gorman
Global SchoolNet Foundation -
Linking Kids Around the World!
Copyright GSN - All Rights Reserved
- Comments
& Questions
Visit GSN's
Global
Schoolhouse for more exciting learning resources!
Search our Site
-
Home