<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://pickwiki.org/index.php?action=history&amp;feed=atom&amp;title=Sudoku</id>
	<title>Sudoku - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://pickwiki.org/index.php?action=history&amp;feed=atom&amp;title=Sudoku"/>
	<link rel="alternate" type="text/html" href="https://pickwiki.org/index.php?title=Sudoku&amp;action=history"/>
	<updated>2026-04-28T23:20:41Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://pickwiki.org/index.php?title=Sudoku&amp;diff=2253&amp;oldid=prev</id>
		<title>Conversion script: link fix</title>
		<link rel="alternate" type="text/html" href="https://pickwiki.org/index.php?title=Sudoku&amp;diff=2253&amp;oldid=prev"/>
		<updated>2015-02-26T23:48:56Z</updated>

		<summary type="html">&lt;p&gt;link fix&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Back to [[BasicSource]]&lt;br /&gt;
&lt;br /&gt;
This is a simple program to play a sudoku game.&lt;br /&gt;
&lt;br /&gt;
I found a file SUDOKU17.TXT on the Internet which had over 30,000 games and assume you could use it.  The program can save and restore a game as &amp;quot;GAME&amp;quot; in whatever file you keep the sudoku text file.&lt;br /&gt;
&lt;br /&gt;
If there is an &amp;quot;H&amp;quot; in the command line, the display is larger.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
     PROGRAM SUDOKU&lt;br /&gt;
&lt;br /&gt;
* Public Domain program provided by Keith Robert Johnson&lt;br /&gt;
&lt;br /&gt;
     OPEN &amp;#039;YOUR.FILE&amp;#039; TO YOUR.FILE ELSE STOP 201,&amp;#039;YOUR.FILE&amp;#039;&lt;br /&gt;
&lt;br /&gt;
     DIM GAME(3)&lt;br /&gt;
     EQU THAT TO GAME(1), BASE TO GAME(2), MINE TO GAME(3)&lt;br /&gt;
&lt;br /&gt;
     MAT GAME = &amp;#039;&amp;#039;&lt;br /&gt;
     AUTO = @FALSE&lt;br /&gt;
&lt;br /&gt;
     THAT = RND(35396)+1&lt;br /&gt;
     READV THAT FROM YOUR.FILE, &amp;#039;SUDOKU17.TXT&amp;#039;, THAT ELSE&lt;br /&gt;
        THAT = &amp;#039; 8   3     7   2 8   5 84  8    9 244       &amp;#039;&lt;br /&gt;
        THAT := &amp;#039;192 1    6  52 1   1 2   3     4   7 &amp;#039;&lt;br /&gt;
     END&lt;br /&gt;
     CONVERT &amp;#039;0&amp;#039; TO &amp;#039; &amp;#039; IN THAT&lt;br /&gt;
     Z = 0&lt;br /&gt;
     FOR Y = 1 TO 9&lt;br /&gt;
        FOR X = 1 TO 9&lt;br /&gt;
           Z += 1&lt;br /&gt;
           BIT = THAT[Z,1]&lt;br /&gt;
           IF BIT MATCHES &amp;#039;1N&amp;#039; THEN BASE&amp;lt;1,X,Y&amp;gt; = BIT&lt;br /&gt;
        NEXT X&lt;br /&gt;
     NEXT Y&lt;br /&gt;
     MINE = BASE&lt;br /&gt;
&lt;br /&gt;
START:&lt;br /&gt;
* Display the grid&lt;br /&gt;
     CRT @(-1)&lt;br /&gt;
     CRT @(0,1):&lt;br /&gt;
     HUGE = INDEX(@SENTENCE,&amp;#039;H&amp;#039;,1)&lt;br /&gt;
     IF HUGE THEN&lt;br /&gt;
        XSIZ = 19; YSIZ = 37; XREM = 6; YREM = 12&lt;br /&gt;
     END ELSE&lt;br /&gt;
        XSIZ = 13; YSIZ = 19; XREM = 4; YREM = 6&lt;br /&gt;
     END&lt;br /&gt;
     FOR X = 1 TO XSIZ&lt;br /&gt;
        CRT &amp;#039;  &amp;#039;:&lt;br /&gt;
        FOR Y = 1 TO YSIZ&lt;br /&gt;
           IF REM(X,XREM) EQ 1 THEN&lt;br /&gt;
              IF REM(Y,YREM) EQ 1 THEN CRT &amp;#039;+&amp;#039;: ELSE CRT &amp;#039;-&amp;#039;:&lt;br /&gt;
           END ELSE&lt;br /&gt;
              IF REM(Y,YREM) EQ 1 THEN CRT &amp;#039;|&amp;#039;: ELSE CRT &amp;#039; &amp;#039;:&lt;br /&gt;
           END&lt;br /&gt;
        NEXT Y&lt;br /&gt;
        CRT&lt;br /&gt;
     NEXT X&lt;br /&gt;
&lt;br /&gt;
     CRT &amp;#039;Use SEXD to move around, 1-9 to write or 0 to clear number&amp;#039;&lt;br /&gt;
     CRT &amp;#039;  C to check position, A to toggle autocheck, Q to quit&amp;#039;&lt;br /&gt;
     CRT &amp;#039;  K to keep game, G to get saved game&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* Display the contents&lt;br /&gt;
     FOR Y = 1 TO 9&lt;br /&gt;
        FOR X = 1 TO 9&lt;br /&gt;
           Z += 1&lt;br /&gt;
           BIT = MINE&amp;lt;1,X,Y&amp;gt;&lt;br /&gt;
           IF HUGE&lt;br /&gt;
              THEN CRT @(4*X,2*Y):&lt;br /&gt;
              ELSE CRT @(2*X+1,Y+INT((Y+2)/3)):&lt;br /&gt;
           IF BIT MATCHES &amp;#039;1N&amp;#039; THEN&lt;br /&gt;
              IF BASE&amp;lt;1,X,Y&amp;gt; MATCHES &amp;#039;1N&amp;#039;&lt;br /&gt;
                 THEN CRT @(-58):BIT:@(-59):&lt;br /&gt;
                 ELSE CRT BIT:&lt;br /&gt;
           END ELSE CRT &amp;#039;.&amp;#039;:&lt;br /&gt;
        NEXT X&lt;br /&gt;
     NEXT Y&lt;br /&gt;
&lt;br /&gt;
* Play loop&lt;br /&gt;
     X = 1; Y = 1&lt;br /&gt;
     LOOP&lt;br /&gt;
        IF HUGE&lt;br /&gt;
           THEN POSN = @(4*X,2*Y)&lt;br /&gt;
           ELSE POSN = @(2*X+1,Y+INT((Y+2)/3))&lt;br /&gt;
        CRT POSN:&lt;br /&gt;
        THIS = UPCASE(KEYIN())&lt;br /&gt;
        CRT @(0,23):@(-4):&lt;br /&gt;
     UNTIL THIS EQ &amp;#039;Q&amp;#039; DO&lt;br /&gt;
        LOOP&lt;br /&gt;
           INPUT FULL,-1&lt;br /&gt;
        WHILE FULL DO&lt;br /&gt;
           FULL = KEYIN()&lt;br /&gt;
        REPEAT&lt;br /&gt;
        CRT POSN:&lt;br /&gt;
        BEGIN CASE&lt;br /&gt;
           CASE THIS EQ &amp;#039;A&amp;#039;; AUTO = NOT(AUTO)&lt;br /&gt;
           CASE THIS EQ &amp;#039;S&amp;#039; AND X GT 1 ; X -= 1&lt;br /&gt;
           CASE THIS EQ &amp;#039;D&amp;#039; AND X LT 9 ; X += 1&lt;br /&gt;
           CASE THIS EQ &amp;#039;E&amp;#039; AND Y GT 1 ; Y -= 1&lt;br /&gt;
           CASE THIS EQ &amp;#039;X&amp;#039; AND Y LT 9 ; Y += 1&lt;br /&gt;
           CASE THIS EQ &amp;#039;C&amp;#039; ; GOSUB CHECK&lt;br /&gt;
           CASE THIS EQ &amp;#039;K&amp;#039; ; MATWRITE GAME ON YOUR.FILE,&amp;#039;GAME&amp;#039;&lt;br /&gt;
           CASE THIS EQ &amp;#039;G&amp;#039;&lt;br /&gt;
              READ TEST FROM YOUR.FILE,&amp;#039;GAME&amp;#039; THEN&lt;br /&gt;
                 MATREAD GAME FROM YOUR.FILE,&amp;#039;GAME&amp;#039; THEN&lt;br /&gt;
                    GO START&lt;br /&gt;
                 END&lt;br /&gt;
              END&lt;br /&gt;
              CRT @(0,23):&amp;#039;NO GAME SAVED&amp;#039;:&lt;br /&gt;
           CASE BASE&amp;lt;1,X,Y&amp;gt; MATCHES &amp;#039;1N&amp;#039; ; CRT CHAR(7):&lt;br /&gt;
           CASE THIS EQ &amp;#039;0&amp;#039; OR THIS EQ &amp;#039; &amp;#039; ; MINE&amp;lt;1,X,Y&amp;gt; = &amp;#039;&amp;#039; ; CRT &amp;#039;.&amp;#039;:&lt;br /&gt;
           CASE THIS MATCHES &amp;#039;1N&amp;#039; ; MINE&amp;lt;1,X,Y&amp;gt; = THIS ; CRT THIS:&lt;br /&gt;
           CASE 1 ; CRT CHAR(7):&lt;br /&gt;
        END CASE&lt;br /&gt;
        IF AUTO THEN GOSUB CHECK&lt;br /&gt;
     REPEAT&lt;br /&gt;
     STOP&lt;br /&gt;
&lt;br /&gt;
CHECK:&lt;br /&gt;
     CRT @(0,23):&lt;br /&gt;
     GOOD = &amp;#039;Everything good so far!&amp;#039;&lt;br /&gt;
* Check Columns&lt;br /&gt;
     THIS = &amp;#039; Column &amp;#039;&lt;br /&gt;
     FOR AA = 1 TO 9&lt;br /&gt;
        LINE = &amp;#039;&amp;#039;&lt;br /&gt;
        FOR BB = 1 TO 9&lt;br /&gt;
           BIT = MINE&amp;lt;1,AA,BB&amp;gt;&lt;br /&gt;
           IF BIT NE &amp;#039;&amp;#039; THEN&lt;br /&gt;
              IF INDEX(LINE,BIT,1) THEN&lt;br /&gt;
                 CRT THIS:AA: ; THIS = &amp;#039;,&amp;#039; ; BB = 99 ; GOOD = &amp;#039; BAD&amp;#039;&lt;br /&gt;
              END ELSE LINE := BIT&lt;br /&gt;
           END&lt;br /&gt;
        NEXT BB&lt;br /&gt;
     NEXT AA&lt;br /&gt;
&lt;br /&gt;
* Check Rows&lt;br /&gt;
     THIS = &amp;#039; Row &amp;#039;&lt;br /&gt;
     FOR AA = 1 TO 9&lt;br /&gt;
        LINE = &amp;#039;&amp;#039;&lt;br /&gt;
        FOR BB = 1 TO 9&lt;br /&gt;
           BIT = MINE&amp;lt;1,BB,AA&amp;gt;&lt;br /&gt;
           IF BIT NE &amp;#039;&amp;#039; THEN&lt;br /&gt;
              IF INDEX(LINE,BIT,1) THEN&lt;br /&gt;
                 CRT THIS:AA: ; THIS = &amp;#039;,&amp;#039; ; BB = 99 ; GOOD = &amp;#039; BAD&amp;#039;&lt;br /&gt;
              END ELSE LINE := BIT&lt;br /&gt;
           END&lt;br /&gt;
        NEXT BB&lt;br /&gt;
     NEXT AA&lt;br /&gt;
&lt;br /&gt;
* Check Cells - couldn&amp;#039;t figure out an algorithm&lt;br /&gt;
     THIS = &amp;#039; Cell &amp;#039;&lt;br /&gt;
     CELL = &amp;#039;1*11,12,13,21,22,23,31,32,33&amp;#039;; GOSUB DOCELL&lt;br /&gt;
     CELL = &amp;#039;2*41,42,43,51,52,53,61,62,63&amp;#039;; GOSUB DOCELL&lt;br /&gt;
     CELL = &amp;#039;3*71,72,73,81,82,83,91,92,93&amp;#039;; GOSUB DOCELL&lt;br /&gt;
     CELL = &amp;#039;4*14,15,16,24,25,26,34,35,36&amp;#039;; GOSUB DOCELL&lt;br /&gt;
     CELL = &amp;#039;5*44,45,46,54,55,56,64,65,66&amp;#039;; GOSUB DOCELL&lt;br /&gt;
     CELL = &amp;#039;6*74,75,76,84,85,86,94,95,96&amp;#039;; GOSUB DOCELL&lt;br /&gt;
     CELL = &amp;#039;7*17,18,19,27,28,29,37,38,39&amp;#039;; GOSUB DOCELL&lt;br /&gt;
     CELL = &amp;#039;8*47,48,49,57,58,59,67,68,69&amp;#039;; GOSUB DOCELL&lt;br /&gt;
     CELL = &amp;#039;9*77,78,79,87,88,89,97,98,99&amp;#039;; GOSUB DOCELL&lt;br /&gt;
&lt;br /&gt;
     CRT GOOD:&lt;br /&gt;
     RETURN&lt;br /&gt;
&lt;br /&gt;
DOCELL:&lt;br /&gt;
     ID = CELL[1,1]&lt;br /&gt;
     CELL = CELL[3,99]&lt;br /&gt;
     CONVERT &amp;#039;,&amp;#039; TO @AM IN CELL&lt;br /&gt;
     LINE = &amp;#039;&amp;#039;&lt;br /&gt;
     FOR AA = 1 TO 9&lt;br /&gt;
        BIT = MINE&amp;lt;1,CELL&amp;lt;AA&amp;gt;[1,1],CELL&amp;lt;AA&amp;gt;[2,1]&amp;gt;&lt;br /&gt;
        IF BIT NE &amp;#039;&amp;#039; THEN&lt;br /&gt;
           IF INDEX(LINE,BIT,1) THEN&lt;br /&gt;
              CRT THIS:ID: ; THIS = &amp;#039;,&amp;#039; ; AA = 99 ; GOOD = &amp;#039; BAD&amp;#039;&lt;br /&gt;
           END ELSE LINE := BIT&lt;br /&gt;
        END&lt;br /&gt;
     NEXT AA&lt;br /&gt;
     RETURN&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;/div&gt;</summary>
		<author><name>Conversion script</name></author>
	</entry>
</feed>