EDSAC Source

This page lists the source code for the worlds first computer game and incidentally the worlds first computer based version of noughts and crosses (tic tac toe).

This is the original source code written by A.S. Douglas that was loaded from a punched paper tape and run on the EDSAC machine. It is written in an assembler. even for those of us who are unfamiliar with the EDSAC instruction set and it’s assembly language some parts of the code look reasonably comprehensible. The most impressive feature is it’s length - this very short piece of code manages a good game of noughts and crosses.

Keen to find out more? Then download the EDSAC simulator and the documentation from www.dcs.warwick.ac.uk/~edsac/ You can then follow this algorithm or try your hand at programming the worlds first programmable computer.

[OXO]
T56K
[M3]
PFGKIFAFRDLFUFOFE@A6FG@E8FEZPF
@&#9!8!7!!!!!!!*NOUGHTS!AND!CROSSES
@&#6!5!4!!!!!!!*!!!!!!!!BY
@&#3!2!1!!!!!!!*A!S!DOUGLAS#N!*C#M1952
@&@&*LOADING!PLEASE!WAIT#MMM
..PK
T45KP192F  [H-parm]
T50KP512F  [X-parm]
T46KP352F  [N-parm]

T64K
GKT48KP@TZ
[&-sequence]
P4FPFP1FP2FP3FP4FP8FP10FP12FP16F
P300FP32FAHOFU1FU2FK4098FM1FA2DPF

T96K
[C-sequence]
GKT54KP@TZ
P3072FP24FP2F&FPFPFPFPFIFP1F
.FPD.FV2047F&FP1DPFPFPFPFQ1024F

T128K
[Special Sequence]
GKT53KP@TZ
ZFS2&S2&S2&S2&S2&S2&S2&S2&S2&
A7&T14BA12BGHZFA15BGNA17BGXPFZF

T160K
[Draw Grid]
GKT44KP@TZ
A15&T20@A#CUDU2DU4DU6DU8DU12DU14D
U16DU18DU22DU24DU26DU28DT30DS2#CU10DT20DZFPF

T192K
[Plant Routine]
GKT45KP@TZ
T55KP108@TZA3&U4@A14&T106@ZFTVXFXFXFXFXFXF
A8#CT4#CA10#CT6#CA&L1024FE24@T32FS12#CT4#CA14#CT6#CT32FAVA3V
T29@XFZFE47@E56@E38@E47@E56@E38@E47@E56@
A4#CL512FT4#CA6#CL512FT6#CE56@XFXF
A4#CR512FT4#CA6#CR512FT6#CXFXFXF
SVXFA4&E85@XFA4&E74@T32FXF
A24DA4#CU24DT26DA22DA6#CU22DT28DE96@T32F
A14DA4#CU14DT16DA12DA6#CU12DT18DE96@XFT32F
 A4DA4#C U4D T6D A2DA6#C U2D T8DXFXF
A&L1024FG103@T&A8&T&E106@T&A5&T&
ZFPF
PF.F.FE29@

T320K
[Search routine]
GKT47KP@TZ
GKA3&U8@A15&U20@S2&T22@A18&T13@AFS5&
E24@A23@T14@A2DZFL512FL512FL8FG21@T32F
ZFT32FZFE18@S4&T34FA13@A7&T13@A34FG11@E24@

T352K
[Opponent's Routine]
GKT46KP@TZ
GKT55KP45@TZ
A15&T44@O1VO2VO3VO6VO7VO@O12VO5V
O8VO11@O9VO16@O4VO10VE20@T32FO11VXF
T32FZFXFUVU35@T43@SVE17@T32FAV
S7&E17@T32FA33@GMPFE17@
AVL512FTVOV
A41@
GHPFZF
PF@F&F*F#F!FDFIFMFVFCFBFLF

T416K
GKT49KP@TZ
[Winning Print Routine]
GKT55KP11@TZ
A15&T14@A2@G832F@24F*3FD12FA30F!2FO22F#23FM23F.FT13&ZF

GKT55KP11@TZ
A15&T10@XFOVO1VO2VO3VO3VO3VXFZF
@F&F*FXF

T448K
[Auxiliary to end-game routine]
GKT51KP@TZ
H20CA3&U9@A2&U46@A14&T43@T34FT36DAF
U33FS5&G48@S4&G50@S4&T32FA7&A7&A18&
T24@A32FA52@T25@A2DZFL512FL512FU35FL8F
G34@T32FA33FT36FT32FC35FR256FA34FT34FA37F
A2&U37FS4&ZFT32FA33FAFE10@T32FE19@
T32FE18@E29@

T512K
[End-game routine]
GKT50KP@TZ
A3&U49@U68@A14&U67@T88@T92@A4&T1&A18@
T21@T59@A2&U37@U36@A25@T17@ZFE34@E34@
E34@ZFE81@E87@E34@E17@E75@A2&U36@T1&
A4&T37@A26@T21@A34@GGP1FP1FA34FA58@
T41@ZFE55@E55@E60@E55@E68@E52@E72@AF
A88@T88@A2&A59@T59@A36@A1&E14@E42@PF
A36FT64@A62@GHPFA65@GLZFAFA88@
T88@E55@A36FT92@E55@A5&U37@T1&A2&T36@
E34@A3&T37@A4&U36@T1&E34@S92@ZFT32F
A90@GHPFA59@S5&E67@T32FA97@GNA67@E5@

T640K
[Master Routine 1]
GKA15&T20BA5&T&A4@GHP9FA7@GNA9@
GMP7FE37@A13@GMP8FE37@A17@GHP7F
A20@GNA22@GXP1FE20BE5BE32@ZFZF
E4BE20BA32@GMP1FE3BE1BA37@GHP3F
A40@GNA42@GMP6FE1BE17B

T704K
[Master Routine 2]
GKA15&T20BA8&T&A4@GNA6@GMP5FE25@
A10@GHP5FA13@GNA15@GXP1FE20BE40@
E49@E95@ZFE20BZFA25@GHP9FA28@GN
A30@GXP1FE20BE7BEFZFE3BZFE20B
A40@GMP8FE9BA44@GMP6FE9BE8BA49@
GMP9FE75@A53@GMP7FE80@A57@GMP3F
E85@A61@GMP8FE90@A65@GMP6FE70@E3B
A70@GMP1FE8BE1BA75@GMP4FE2BE4B
A79@GMP6FE2BE6BA85@GMP8FE4BE8B
A90@GMP4FE9BE7BA95@GMP2FE6BE2B

T832K
[Print caption]
GKA3&U4@A14&T10@ZFU33FE12@A11@G12@T32F
ZFVFT32FO33FA33FL512FT33FO33FA4@A2&
T4@A10@A2&T10@E4@

T864K
[My Master]
GKS13&E15@T32FA3@G832F@24F*19FR28FW22F!27F
A23FE11FM23FM16F.FT32FA10&T13&A18@G832F
@24F@24F*3FD12FA30F#26F*16FU12FE4F!17FI4F
S5F!11FK15FD8FA25F!11FP26FQ25FC16F
.FZFXFS2&G55@S2&G58@S6&G55@O37@
A50@G!A52@G640FE@O64@T32FE41@O38@A59@
G!A61@G704FE@BF

E15ZPF
 

[ Home] [About Us] [Systems] [Software Review]

Google
  Web www.adit.co.uk