Simple Sudoku puzzle (updated with 500 puzzles) - Dav - 06-08-2024
This is a simple to play sudoku puzzle with 500 easy level puzzles to solve. I hesitated sharing this because the code is so jumbled up, but I probably won't ever clean it up so here it is. Maybe somebody would like a portable sudoku program. Screen size will adjust to 75% of users desktop height, so the puzzle should look nice on any screen. If you want to see a REALLy good sudoku in QB64 then I highly recommend looking up the one @bplus made.
Left click to add a number to a cell, right click on a number to erase it.
SPACE will reset puzzle, ENTER will go to a random puzzle #.
Use +/- keys to jump to different puzzles quickly.
Press T to play with timer (shows in title bar).
R will reset all puzzles to unsolved.
Game progress now saved to a sudoko.dat file in current directory so you can continue where you left off.
- Dav
EDIT: Updated version - now saves game progress and solved puzzles.
Code: (Select All) '==========
'SUDOKU.BAS v1.2
'==========
'A simple and easy to use sudoku puzzle.
'Contains 500 solvable easy level puzzles.
'Coded by Dav JUN/2024 using QB64PE v3.13.0
'
'Added: Puzzle progress now saved.
' Continue where you left off!
' (sudoku.dat file is saved in dir)
'Added: Press 'R' to reset all 500 puzzles
'==================================================
'This is a classic sudoku puzzle implementation.
'Left click on a cell to assign a number to it.
'A number box will pop up. Click on desired number.
'(keys 1 - 9 can also be used when number box shows)
'Number turn red whenever there's a conflict.
'Right click on numbers to remove them off the board.
'(or select same number from numbox to remove it).
'The current puzzle number is displayed in Title bar.
'Use +/- keys to navigate to a certain puzzle number.
'ENTER gets a random puzzle number.
'SPACE will reset current puzzle.
'R will reset(clear) all puzzles.
'ESC key quits the game.
'You can press T to turn Timer ON/OFF if you want
'to play with a timer. (time shows in title bar).
'The timer shows how long you has spent on the
'current puzzle.
'When the current puzzle is solved the next puzzle
'number is selected automatically.
'Visit my little QB64PE Programming Corner here:
'https://qb64phoenix.com/forum/showthread.php?tid=128
'-Dav
grid = 9 ' grid size is is 9x9
cells = grid * grid ' number of cells on grid
Dim cellx(grid * grid), celly(grid * grid) 'top x/y cords of cells
Dim cellx2(grid * grid), celly2(grid * grid) ' bottom x/y cords of cells
Dim Shared cellstate(grid * grid) 'flag that for hard coded numbers (can't change these on board)
Dim Shared cellvalue(grid * grid) 'holds the cell number values
Dim Shared puznum, puzmax: puzmax = 500
Dim Shared puz$(puzmax)
dh = _DesktopHeight * .75
size = Int(dh / grid) ' size of cells
Screen _NewImage(size * grid, size * grid, 32)
BIGFONT Int(_Height / 9)
Randomize 1234 'define seed so generated puzzle # stay same every run
puznum = 1 'defaults to puzzle 1
On Timer(1) GoSub TitleTimer
TimerFlag = 0
'========
createdat:
'========
If Not _FileExists("sudoku.dat") Then
Open "sudoku.dat" For Output As #1
'=== Generate 500 puzzles
For p = 1 To puzmax
puz$(p) = NewPuz$
Print #1, puz$(p); 'save puzzle data
Next
Print #1, MKL$(1); 'save current puzzle #
Close 1
End If
Open "sudoku.dat" For Binary As #1
'check for correct data size
If LOF(1) <> ((162 * puzmax) + 4) Then
Close 1
Kill "sudoku.dat"
GoTo createdat
End If
'load puzzle data
For p = 1 To puzmax
in$ = Input$(162, 1) 'load puzzle data
puz$(p) = in$
Next
'=== load current puzzle
puznum = CVL(Input$(4, 1))
Close 1
'========
Start:
'========
_Title "Sudoku #" + _Trim$(Str$(puznum))
bc = 1 'counter
For col = 1 To grid
For row = 1 To grid
x = (row * size): y = (col * size)
cellx(bc) = x - size: cellx2(bc) = x ' generate x/y values
celly(bc) = y - size: celly2(bc) = y
cellvalue(bc) = Val(Mid$(puz$(puznum), bc, 1))
cellstate(bc) = Val(Mid$(puz$(puznum), 81 + bc, 1))
bc = bc + 1
Next
Next
If TimerFlag = 1 Then
StartTime = Timer
Timer On
Else
Timer Off
End If
_PrintMode _KeepBackground
GoSub UpdateBoard
Do
ky$ = InKey$
If ky$ = " " Then
'clear puz$ data with cellstate of 0
For p = 1 To 81
If cellstate(p) = 0 Then Mid$(puz$(puznum), p, 1) = "0"
Next
GoTo Start 'SPACE resets puzzle
End If
If ky$ = Chr$(13) Then 'get a random puzzle to play
'sets a random new puzzle
'make sure it's not same as current puznum
curpuz = puznum
Do
puznum = Int(Rnd * puzmax) + 1
Loop Until puznum <> curpuz
GoTo Start
End If
If ky$ = "+" Then
puznum = puznum + 1
If puznum > puzmax Then
puznum = 1
End If
GoTo Start
End If
If ky$ = "-" Then
puznum = puznum - 1
If puznum < 1 Then
puznum = puzmax
End If
GoTo Start
End If
If UCase$(ky$) = "R" Then
Kill "sudoku.dat"
GoTo createdat
End If
If UCase$(ky$) = "T" Then
_Delay .25
If TimerFlag = 1 Then
Timer Off
TimerFlag = 0
'refresh titlebar without time display
_Title "Sudoku #" + _Trim$(Str$(puznum))
Else
TimerFlag = 1
StartTime = Timer
Timer On
End If
_KeyClear
End If
If ky$ = Chr$(27) Then System
While _MouseInput: Wend
If _MouseButton(1) Or _MouseButton(2) Then
mx = _MouseX: my = _MouseY
'see if a button was pressed
For T = 1 To cells
bx = cellx(T): bx2 = cellx2(T)
by = celly(T): by2 = celly2(T)
If mx >= bx And mx <= bx2 And my >= by And my <= by2 Then
If _MouseButton(1) Then
'only if clicking no assigned number
If cellstate(T) = 0 Then
'popup number box here
'keep x box values in bounds
x1 = cellx(T) + (size / 2) - size
If x1 < (size / 2) Then x1 = (size / 2)
If x1 + (size * 3) > _Width Then
x1 = _Width - (size * 3) - (size / 2)
End If
x2 = x1 + (size * 3)
'keep y box values in bounds
y1 = celly(T) + (size / 2) - size
If y1 < (size / 2) Then y1 = (size / 2)
If y1 + (size * 3) > _Height Then
y1 = _Height - (size * 3) - (size / 2)
End If
y2 = y1 + (size * 3)
'highlight the number to change
Line (cellx(T), celly(T))-(cellx2(T), celly2(T)), _RGBA(255, 255, 255, 100), BF
_Display
_Delay .25
'wait until mouse button up to continue
While _MouseButton(1) <> 0: n = _MouseInput: Wend
'draw popup box
tk = size * .03
Line (x1, y1)-(x2, y2), _RGBA(255, 255, 0, 200), BF
Line (x1 + tk, y1 + tk)-(x2 - tk, y2 - tk), _RGBA(132, 62, 32, 164), BF
'make temp numbox values (assign and show)
ReDim boxx(9), boxy(9), boxx2(9), boxy2(9), boxv(9)
'first row
'1
boxx(1) = x1: boxy(1) = y1: boxx2(1) = x1 + size: boxy2(1) = y1 + size: boxv(1) = 1
bx = boxx(1) - (Int(_Height / 9) / 4.5): by = boxy(1) + (Int(_Height / 9) / 12.5)
Color _RGBA(255, 255, 0, 200): _PrintString (bx, by), Str$(boxv(1))
'2
boxx(2) = x1 + size: boxy(2) = y1: boxx2(2) = x1 + (size * 2): boxy2(2) = y1 + size: boxv(2) = 2
bx = boxx(2) - (Int(_Height / 9) / 4.5): by = boxy(2) + (Int(_Height / 9) / 12.5)
Color _RGBA(255, 255, 0, 200): _PrintString (bx, by), Str$(boxv(2))
'3
boxx(3) = x1 + (size * 2): boxy(3) = y1: boxx2(3) = x1 + (size * 3): boxy2(3) = y1 + size: boxv(3) = 3
bx = boxx(3) - (Int(_Height / 9) / 4.5): by = boxy(3) + (Int(_Height / 9) / 12.5)
Color _RGBA(255, 255, 0, 200): _PrintString (bx, by), Str$(boxv(3))
'second row
'4
boxx(4) = x1: boxy(4) = y1 + size: boxx2(4) = x1 + size: boxy2(4) = y1 + (size * 2): boxv(4) = 4
bx = boxx(4) - (Int(_Height / 9) / 4.5): by = boxy(4) + (Int(_Height / 9) / 12.5)
Color _RGBA(255, 255, 0, 200): _PrintString (bx, by), Str$(boxv(4))
'5
boxx(5) = x1 + size: boxy(5) = y1 + size: boxx2(5) = x1 + (size * 2): boxy2(5) = y1 + (size * 2): boxv(5) = 5
bx = boxx(5) - (Int(_Height / 9) / 4.5): by = boxy(5) + (Int(_Height / 9) / 12.5)
Color _RGBA(255, 255, 0, 200): _PrintString (bx, by), Str$(boxv(5))
'6
boxx(6) = x1 + (size * 2): boxy(6) = y1 + size: boxx2(6) = x1 + (size * 3): boxy2(6) = y1 + (size * 2): boxv(6) = 6
bx = boxx(6) - (Int(_Height / 9) / 4.5): by = boxy(6) + (Int(_Height / 9) / 12.5)
Color _RGBA(255, 255, 0, 200): _PrintString (bx, by), Str$(boxv(6))
'third row
'7
boxx(7) = x1: boxy(7) = y1 + (size * 2): boxx2(7) = x1 + size: boxy2(7) = y1 + (size * 7): boxv(7) = 7
bx = boxx(7) - (Int(_Height / 9) / 4.5): by = boxy(7) + (Int(_Height / 9) / 12.5)
Color _RGBA(255, 255, 0, 200): _PrintString (bx, by), Str$(boxv(7))
'8
boxx(8) = x1 + size: boxy(8) = y1 + (size * 2): boxx2(8) = x1 + (size * 2): boxy2(8) = y1 + (size * 3): boxv(8) = 8
bx = boxx(5) - (Int(_Height / 9) / 4.5): by = boxy(8) + (Int(_Height / 9) / 12.5)
Color _RGBA(255, 255, 0, 200): _PrintString (bx, by), Str$(boxv(8))
'9
boxx(9) = x1 + (size * 2): boxy(9) = y1 + (size * 2): boxx2(9) = x1 + (size * 3): boxy2(9) = y1 + (size * 3): boxv(9) = 9
bx = boxx(6) - (Int(_Height / 9) / 4.5): by = boxy(9) + (Int(_Height / 9) / 12.5)
Color _RGBA(255, 255, 0, 200): _PrintString (bx, by), Str$(boxv(9))
_Display
'wait until mouse button up to continue
While _MouseButton(1) <> 0: n = _MouseInput: Wend
'Sleep 1
'get click in numbox
Do
While _MouseInput: Wend
If _MouseButton(1) Then
mmx = _MouseX: mmy = _MouseY
'see if a button was pressed in numbox
For tt = 1 To 9
If mmx >= boxx(tt) And mmx <= boxx2(tt) And mmy >= boxy(tt) And mmy <= boxy2(tt) Then
Line (boxx(tt), boxy(tt))-Step(size, size), _RGBA(255, 255, 255, 100), BF
_Display
_Delay .25
'assign picked number with board number
If boxv(tt) = cellvalue(T) Then
cellvalue(T) = 0 'if same, then clear it
Mid$(puz$(puznum), T, 1) = "0"
Else
cellvalue(T) = boxv(tt)
Mid$(puz$(puznum), T, 1) = _Trim$(Str$(cellvalue(T)))
End If
Exit Do
End If
Next
End If
'optional keyboard input
k$ = InKey$
Select Case k$
Case Is = "1", "2", "3", "4", "5", "6", "7", "8", "9"
kv = Val(k$)
If kv = cellvalue(T) Then
cellvalue(T) = 0 'if same, then clear it
Mid$(puz$(puznum), T, 1) = "0"
Else
cellvalue(T) = kv
Mid$(puz$(puznum), T, 1) = _Trim$(Str$(kv))
End If
Exit Do
End Select
_Limit 200
Loop Until _MouseButton(1)
'wait until mouse button up to continue
While _MouseButton(1) <> 0: n = _MouseInput: Wend
End If
Else
'must be right click, so remove number here
'only if clicking no assigned number
If cellstate(T) = 0 Then
cellvalue(T) = 0
Mid$(puz$(puznum), T, 1) = "0"
End If
End If
End If
Next
GoSub UpdateBoard
'===================
'check for win here...
'first see if any 0's present (empty cells)
'and if any conflicts are present
solved = 1
For c = 1 To 81
If cellvalue(c) = 0 Then solved = 0: Exit For
If Conflict(c) = -1 Then solved = 0: Exit For
Next
'if solved = 1 then level solved!.
If solved = 1 Then
Line (size * 2, size * 2)-(size * 7, size * 4), _RGBA(32, 32, 32, 200), BF
Line (size * 2.1, size * 2.1)-(size * 6.9, size * 3.9), _RGBA(250, 200, 200, 200), B
Color _RGBA(250, 250, 250, 200)
_PrintString (size * 2.5, size * 2.5), "Solved!!"
_Display
_Delay 4
GoSub UpdateBoard
_Delay 2
puznum = puznum + 1
If puznum > puzmax Then
puznum = 1
End If
GoTo Start
End If
End If
_Limit 200
Loop
End
'==========
UpdateBoard:
'==========
Cls , _RGB(100, 0, 0)
bc = 1
For row = 1 To grid
For col = 1 To grid
bx = cellx(bc) - (Int(_Height / 9) / 4.5)
by = celly(bc) + (Int(_Height / 9) / 14.5)
'if value not a zero...
If cellvalue(bc) <> 0 Then
'shadow
Color _RGB(0, 0, 0)
_PrintString (bx + (size * .03), by + (size * .03)), Str$(cellvalue(bc))
'if assigned puz number
If cellstate(bc) = 1 Then
Color _RGB(230, 130, 80)
Else
'check if conflict on row or column here <<<<<
If Conflict(bc) = -1 Then
'red color
Color _RGB(255, 64, 64)
Else
Color _RGB(255, 180, 125)
End If
End If
_PrintString (bx, by), Str$(cellvalue(bc))
End If
Line (cellx(bc), celly(bc))-(cellx2(bc), celly2(bc)), _RGB(200, 100, 50), B
bc = bc + 1
Next
Next
'draw thicker lines
tk = size * .03
Line (0, size * 3 - tk)-(_Width, size * 3 + tk + tk), _RGB(0, 0, 0), BF
Line (0, size * 3 - tk)-(_Width, size * 3 + tk), _RGB(200, 100, 50), BF
Line (0, size * 6 - tk)-(_Width, size * 6 + tk + tk), _RGB(0, 0, 0), BF
Line (0, size * 6 - tk)-(_Width, size * 6 + tk), _RGB(200, 100, 50), BF
Line (size * 3 - tk, 0)-(size * 3 + tk, _Height), _RGB(200, 100, 50), BF
Line (size * 6 - tk, 0)-(size * 6 + tk, _Height), _RGB(200, 100, 50), BF
For f = 0 To (size * .06)
Line (0 + f, 0 + f)-(_Width - f, _Height - f), _RGB(200, 100, 50), B
Next
_Display
'====== Update sudoku.dat with changes
Open "sudoku.dat" For Output As 1
For p = 1 To puzmax
Print #1, puz$(p);
Next
'save current puzzle place#
Print #1, MKL$(puznum);
Close 1
Return
'=========
TitleTimer:
'=========
Elapsed = Timer - StartTime
secs = Elapsed
If Elapsed >= 60 Then
Mins = Fix(Elapsed / 60)
secs = Elapsed - (60 * Mins)
End If
If Mins >= 60 Then
Hrs = Fix(Mins / 60)
Mins = Mins - (60 * Hrs)
End If
secs = Fix(secs)
Hrs$ = _Trim$(Str$(Hrs)): If Len(Hrs$) = 1 Then Hrs$ = "0" + Hrs$
min$ = _Trim$(Str$(Mins)): If Len(min$) = 1 Then min$ = "0" + min$
Secs$ = _Trim$(Str$(secs)): If Len(Secs$) = 1 Then Secs$ = "0" + Secs$
tit$ = Hrs$ + ":" + min$ + ":" + Secs$
_Title "Sudoku #" + _Trim$(Str$(puznum)) + " - " + tit$
Return
Function NewPuz$
'generates different sudoku puzzles using randomizing techniques
'and from a pool of pre-made solved sudoku puzzles.
'select from a pool of 15 puzzles
p = Int(Rnd * 15) + 1
If p = 1 Then p$ = "564973128819624375372815946247356891938741652651289734126597483495138267783462519"
If p = 2 Then p$ = "743589162219634758856271349137956284684723591592148673368417925475392816921865437"
If p = 3 Then p$ = "395842716762931845841765293986123457417589362253476981674218539538697124129354678"
If p = 4 Then p$ = "954182367163794258278563194749625813681379425532418976426851739395247681817936542"
If p = 5 Then p$ = "387142695954386271126957483571263948248579316639418752893721564462895137715634829"
If p = 6 Then p$ = "859643271371925684264187359927316845543872916618594723735261498192438567486759132"
If p = 7 Then p$ = "547368291296751348183429675871543962965872134432196587714935826328617459659284713"
If p = 8 Then p$ = "329654817761389524584712369843971652615423798972865143458197236296538471137246985"
If p = 9 Then p$ = "254376819178594362369281745495762138632819457781453296513628974846937521927145683"
If p = 10 Then p$ = "184597362923684571765132489649273815518469723237815694472958136391746258856321947"
If p = 11 Then p$ = "314872695857469321296135748529741863731986452468523917943217586175698234682354179"
If p = 12 Then p$ = "248931657637852914915647238586423791194768523372519846853274169429186375761395482"
If p = 13 Then p$ = "734521986962873145158469372345796821817235469629184537571648293283917654496352718"
If p = 14 Then p$ = "795243618138659427624178539263497185549812763871536294452981376917365842386724951"
If p = 15 Then p$ = "416598723259743861873162495624815379791324586385679214962437158148256937537981642"
'load selected puz$ into cellvalue()
For c = 1 To 81
cellvalue(c) = Val(Mid$(p$, c, 1))
Next
'========== swap rows
'swap top 3 rows randomly
Select Case Int(Rnd * 4) + 1
Case 1 'swap row 1 and 2
For s = 1 To 9: Swap cellvalue(s), cellvalue(s + 9): Next
Case 2 'swap row 1 and 3
For s = 1 To 9: Swap cellvalue(s), cellvalue(s + 18): Next
Case 3 'swap row 2 and 3
For s = 10 To 18: Swap cellvalue(s), cellvalue(s + 9): Next
End Select
'swap middle 3 rows randomly
Select Case Int(Rnd * 4) + 1
Case 1 'swap row 4 and 5
For s = 28 To 36: Swap cellvalue(s), cellvalue(s + 9): Next
Case 2 'swap row 4 and 6
For s = 28 To 36: Swap cellvalue(s), cellvalue(s + 18): Next
Case 3 'swap row 5 and 6
For s = 37 To 45: Swap cellvalue(s), cellvalue(s + 9): Next
End Select
'swap bottom 3 rows a few times
Select Case Int(Rnd * 4) + 1
Case 1 'swap row 7 and 8
For s = 55 To 63: Swap cellvalue(s), cellvalue(s + 9): Next
Case 2 'swap row 7 and 9
For s = 55 To 63: Swap cellvalue(s), cellvalue(s + 18): Next
Case 3 'swap row 8 and 9
For s = 64 To 72: Swap cellvalue(s), cellvalue(s + 9): Next
End Select
'============ swap columns
'swap left 3 columns
Select Case Int(Rnd * 4) + 1
Case 1 'swap column 1 and 2
For s = 1 To 73 Step 9: Swap cellvalue(s), cellvalue(s + 1): Next
Case 2 'swap column 1 and 3
For s = 1 To 73 Step 9: Swap cellvalue(s), cellvalue(s + 2): Next
Case 3 'swap column 2 and 3
For s = 2 To 74 Step 9: Swap cellvalue(s), cellvalue(s + 1): Next
End Select
'swap middle 3 columns
Select Case Int(Rnd * 4) + 1
Case 1 'swap column 4 and 5
For s = 4 To 76 Step 9: Swap cellvalue(s), cellvalue(s + 1): Next
Case 2 'swap column 4 and 6
For s = 4 To 76 Step 9: Swap cellvalue(s), cellvalue(s + 2): Next
Case 3 'swap column 5 and 6
For s = 5 To 77 Step 9: Swap cellvalue(s), cellvalue(s + 1): Next
End Select
'swap right 3 columns
Select Case Int(Rnd * 4) + 1
Case 1 'swap column 7 and 8
For s = 7 To 79 Step 9: Swap cellvalue(s), cellvalue(s + 1): Next
Case 2 'swap column 7 and 9
For s = 7 To 79 Step 9: Swap cellvalue(s), cellvalue(s + 2): Next
Case 3 'swap column 8 and 9
For s = 8 To 80 Step 9: Swap cellvalue(s), cellvalue(s + 1): Next
End Select
'====== now swap blocks of rows (3)
Select Case Int(Rnd * 4) + 1
Case 1 'swap top row of blocks with and middle row
For s = 1 To 9
Swap cellvalue(s), cellvalue(s + 27)
Swap cellvalue(s + 9), cellvalue(s + 36)
Swap cellvalue(s + 18), cellvalue(s + 45)
Next
Case 2 'swap top row of blocks with bottom row of blocks
For s = 1 To 9
Swap cellvalue(s), cellvalue(s + 54)
Swap cellvalue(s + 9), cellvalue(s + 63)
Swap cellvalue(s + 18), cellvalue(s + 72)
Next
Case 3 'swap middle row of blocks with bottom row of blocks
For s = 28 To 36
Swap cellvalue(s), cellvalue(s + 27)
Swap cellvalue(s + 9), cellvalue(s + 36)
Swap cellvalue(s + 18), cellvalue(s + 45)
Next
End Select
'====== now swap columns of blocks
Select Case Int(Rnd * 4) + 1
Case 1 'swap left block column with middle
For s = 1 To 73 Step 9
Swap cellvalue(s), cellvalue(s + 3)
Swap cellvalue(s + 1), cellvalue(s + 4)
Swap cellvalue(s + 2), cellvalue(s + 5)
Next
Case 2 'swap left block column with right
For s = 1 To 73 Step 9
Swap cellvalue(s), cellvalue(s + 6)
Swap cellvalue(s + 1), cellvalue(s + 7)
Swap cellvalue(s + 2), cellvalue(s + 8)
Next
Case 3 'swap middle block of columns withright one
For s = 4 To 76 Step 9
Swap cellvalue(s), cellvalue(s + 3)
Swap cellvalue(s + 1), cellvalue(s + 4)
Swap cellvalue(s + 2), cellvalue(s + 5)
Next
End Select
'=========== swap some numbers..
Select Case Int(Rnd * 5) + 1
Case 1 'swap 1's and 5's
For c = 1 To 81
Select Case cellvalue(c)
Case 1: cellvalue(c) = 5
Case 5: cellvalue(c) = 1
End Select
Next
Case 2 'swap 2's and 6's
For c = 1 To 81
Select Case cellvalue(c)
Case 2: cellvalue(c) = 6
Case 6: cellvalue(c) = 2
End Select
Next
Case 3 'swap 3's and 7's
For c = 1 To 81
Select Case cellvalue(c)
Case 3: cellvalue(c) = 7
Case 7: cellvalue(c) = 3
End Select
Next
Case 4 'swap 4's and 8's
For c = 1 To 81
Select Case cellvalue(c)
Case 4: cellvalue(c) = 8
Case 8: cellvalue(c) = 4
End Select
Next
Case 5 'swap 9's and 1's
For c = 1 To 81
Select Case cellvalue(c)
Case 1: cellvalue(c) = 9
Case 9: cellvalue(c) = 1
End Select
Next
End Select
t$ = ""
'Build NewPuz$, clearing some pieces
For c = 1 To 81
If Int(Rnd * 2) = 1 Then
t$ = t$ + _Trim$(Str$(cellvalue(c)))
Else
t$ = t$ + "0"
End If
Next
e$ = ""
For c = 1 To Len(t$)
If Mid$(t$, c, 1) = "0" Then
e$ = e$ + "0"
Else
e$ = e$ + "1"
End If
Next
t$ = t$ + e$
NewPuz$ = t$
End Function
Function Conflict (num)
'this function checks rows/columns/blocks for any conflicts.
'p$ holds all the other cell numbers to compare 'num' with.
Select Case num
'first row, 01-09
Case 1: p$ = "0203040506070809101928374655647311122021"
Case 2: p$ = "0103040506070809112029384756657410121921"
Case 3: p$ = "0102040506070809122130394857667510111920"
Case 4: p$ = "0102030506070809132231404958677614152324"
Case 5: p$ = "0102030406070809142332415059687713152224"
Case 6: p$ = "0102030405070809152433425160697813142223"
Case 7: p$ = "0102030405060809162534435261707917182627"
Case 8: p$ = "0102030405060709172635445362718016182527"
Case 9: p$ = "0102030405060708182736455463728116172526"
'second row, 10-18
Case 10: p$ = "1112131415161718011928374655647302032021"
Case 11: p$ = "1012131415161718022029384756657401031921"
Case 12: p$ = "1011131415161718032130394857667501021920"
Case 13: p$ = "1011121415161718042231404958677605062324"
Case 14: p$ = "1011121315161718052332415059687704062224"
Case 15: p$ = "1011121314161718062433425160697804052223"
Case 16: p$ = "1011121314151718072534435261707908092627"
Case 17: p$ = "1011121314151618082635445362718007092527"
Case 18: p$ = "1011121314151617092736455463728107082526"
'third row, 19-27
Case 19: p$ = "2021222324252627011028374655647302031112"
Case 20: p$ = "1921222324252627021129384756657401031012"
Case 21: p$ = "1920222324252627031230394857667501021011"
Case 22: p$ = "1920212324252627041331404958677605061415"
Case 23: p$ = "1920212224252627051432415059687704061315"
Case 24: p$ = "1920212223252627061533425160697804051314"
Case 25: p$ = "1920212223242627071634435261707908091718"
Case 26: p$ = "1920212223242527081735445362718007091618"
Case 27: p$ = "1920212223242526091836455463728107081617"
'forth row,28-36
Case 28: p$ = "2930313233343536011019374655647338394748"
Case 29: p$ = "2830313233343536021120384756657437394648"
Case 30: p$ = "2829313233343536031221394857667537384647"
Case 31: p$ = "2829303233343536041322404958677641425051"
Case 32: p$ = "2829303133343536051423415059687740424951"
Case 33: p$ = "2829303132343536061524425160697840414950"
Case 34: p$ = "2829303132333536071625435261707944455354"
Case 35: p$ = "2829303132333436081726445362718043455254"
Case 36: p$ = "2829303132333435091827455463728143445253"
'fifth row,37-45
Case 37: p$ = "3839404142434445011019284655647329304748"
Case 38: p$ = "3739404142434445021120294756657428304648"
Case 39: p$ = "3738404142434445031221304857667528294647"
Case 40: p$ = "3738394142434445041322314958677632335051"
Case 41: p$ = "3738394042434445051423325059687731334951"
Case 42: p$ = "3738394041434445061524335160697831324950"
Case 43: p$ = "3738394041424445071625345261707935365354"
Case 44: p$ = "3738394041424345081726355362718034365254"
Case 45: p$ = "3738394041424344091827365463728134355253"
'sixth row,46-54
Case 46: p$ = "4748495051525354011019283755647329303839"
Case 47: p$ = "4648495051525354021120293856657428303739"
Case 48: p$ = "4647495051525354031221303957667528293738"
Case 49: p$ = "4647485051525354041322314058677632334142"
Case 50: p$ = "4647484951525354051423324159687731334042"
Case 51: p$ = "4647484950525354061524334260697831324041"
Case 52: p$ = "4647484950515354071625344361707935364445"
Case 53: p$ = "4647484950515254081726354462718034364345"
Case 54: p$ = "4647484950515253091827364563728134354344"
'seventh row, 55-63
Case 55: p$ = "5657585960616263011019283746647365667475"
Case 56: p$ = "5557585960616263021120293847657464667375"
Case 57: p$ = "5556585960616263031221303948667564657374"
Case 58: p$ = "5556575960616263041322314049677668697778"
Case 59: p$ = "5556575860616263051423324150687767697678"
Case 60: p$ = "5556575859616263061524334251697867687677"
Case 61: p$ = "5556575859606263071625344352707971728081"
Case 62: p$ = "5556575859606163081726354453718070727981"
Case 63: p$ = "5556575859606162091827364554728170717980"
'eight row, 64-72
Case 64: p$ = "6566676869707172011019283746557356577475"
Case 65: p$ = "6466676869707172021120293847567455577375"
Case 66: p$ = "6465676869707172031221303948577555567374"
Case 67: p$ = "6465666869707172041322314049587659607778"
Case 68: p$ = "6465666769707172051423324150597758607678"
Case 69: p$ = "6465666768707172061524334251607858597677"
Case 70: p$ = "6465666768697172071625344352617962638081"
Case 71: p$ = "6465666768697072081726354453628061637981"
Case 72: p$ = "6465666768697071091827364554638161627980"
'ninth row, 73-81
Case 73: p$ = "7475767778798081011019283746556456576566"
Case 74: p$ = "7375767778798081021120293847566555576466"
Case 75: p$ = "7374767778798081031221303948576655566465"
Case 76: p$ = "7374757778798081041322314049586759606869"
Case 77: p$ = "7374757678798081051423324150596858606769"
Case 78: p$ = "7374757677798081061524334251606958596768"
Case 79: p$ = "7374757677788081071625344352617062637172"
Case 80: p$ = "7374757677787981081726354453627161637072"
Case 81: p$ = "7374757677787980091827364554637261627071"
End Select
For c = 1 To Len(p$) Step 2
chk = Val(Mid$(p$, c, 2))
If cellvalue(chk) = cellvalue(num) Then Conflict = -1
Next
End Function
Sub BIGFONT (size)
'make/load another CP437 font (like QB64's built-in one)'
'This one is resizable so you can make/use larger size SCREEN font.
A$ = ""
A$ = A$ + "haIgm]0MLEMMXkS^ST\\T]lHiaboe<Nl8c71HYa3f0VPiWa9H07n5a_0bn:K"
A$ = A$ + ";#FB8;c773hBD8T42E_#C:=QBC39PSQB=DB2UhdhVBB^9=_D2EQ#Ala?JFmi"
A$ = A$ + "ejeGKNiYTV4\UNkOWcmL791Y0Iefg<NdmNWiLfWmIoO_?WkeP10H6`NP0HS["
A$ = A$ + "KMGj5l9Nf7lH0HC;3of5MAGb9ef>>V6V60Vfa[_^=_m>j[Y]NOC7PDY`?kKc"
A$ = A$ + "gd0IQB1o20VfnaO?eFkH7m=nh8TP=]8ljY]e^_e]DhRj<;0CoG1`5>lfj\S`"
A$ = A$ + "IOn5Z6o]G6oLbK3oRZONcW6QoL`[Gfffn0gBQ5]P_=NmC3#5__^kMcMlg=[o"
A$ = A$ + "a=RPjY`[?W]ga]dWICVEPonZafW]W>fNWObWOGk3P[h7POg7[_Nga07oM<8f"
A$ = A$ + "f[2agZnF0=g`?kjkmmOT[]nel;PVZJ]hg0?OKcLadaGiKoLOB06[_P\Y8lOJ"
A$ = A$ + "#5Pl2kCZm?FO04TU^4o[1Bn:5m=VLhOH8jj9mj4UF4Te<4D9R7[U6eP\fS#H"
A$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D_3\]JdV5fCM^cfd>jT"
A$ = A$ + "1KK]N:C_gn7HKm^eNkYS^[[[N60]XdiV70=ZDKWgh>kjVjXk>kIcMFifjMWk"
A$ = A$ + "XcIdOWgDgm^e^fL7MgC_3<MZaK]o>jNPnLW^Y1VfU\^F9aQE#WdZNb:LWDdN"
A$ = A$ + "BKfCFYmTEK?iD\WLbfCFUmTBj9[d2Wf\M_TM8:IQLA;LJcn=]IKCKFhDbRZ["
A$ = A$ + "dfhRFdX=g9fA_=;nDdMRmWFYM8Je=XF8gV5EGY[aF8_B;n\Bglb2iEJkN9g4"
A$ = A$ + "d1WE:ZKm]Y^kMcg#e8_T>FYLEgKA>fo0je3\S]eAHWEbo]j`KP?FcFjZk^k<"
A$ = A$ + "LCmN;CG>[OTSGm0mgE7KMWm97kG_>\7iHgKYZ=gEoK^k>[Y[N^Y=]C\C3#WY"
A$ = A$ + "Og>fNGXlH7K^CD0jVLG4\SMfCEKYc]SR#YXoDi>j37lDK^kM^Y:gFWMP3AHG"
A$ = A$ + "M\mNk9\f]_cMX2EM>C_cAIOa=ehScNbHoGSl3nVg6Mdooo4noEAM%%h1"
btemp$ = ""
For i& = 1 To Len(A$) Step 4: B$ = Mid$(A$, i&, 4)
If InStr(1, B$, "%") Then
For C% = 1 To Len(B$): F$ = Mid$(B$, C%, 1)
If F$ <> "%" Then C$ = C$ + F$
Next: B$ = C$: End If: For j = 1 To Len(B$)
If Mid$(B$, j, 1) = "#" Then
Mid$(B$, j) = "@": End If: Next
For t% = Len(B$) To 1 Step -1
B& = B& * 64 + Asc(Mid$(B$, t%)) - 48
Next: X$ = "": For t% = 1 To Len(B$) - 1
X$ = X$ + Chr$(B& And 255): B& = B& \ 256
Next: btemp$ = btemp$ + X$: Next
BASFILE$ = _Inflate$(btemp$, 25152): btemp$ = ""
_Font _LoadFont(BASFILE$, size, "memory, monospace")
End Sub
RE: Simple Sudoku puzzle (medium levels) - bplus - 06-08-2024
Well testing this i learned i suck when not able to use notes. interesting way of putting the numbers into board. I'd show the solved board but the game moved onto a new board before i could take a picture of my win.
@Dav you must be in-between gigs judging by recent posting frequency
RE: Simple Sudoku puzzle (medium levels) - Dav - 06-08-2024
I just fixed a couple of typos in the Conflict error checking function that sometimes returned false errors. Please re-download for the fixed version.
@bplus, yep, the last couple of weeks have been a little lite, gig wise.
- Dav
RE: Simple Sudoku puzzle (medium levels) - Dav - 06-09-2024
By the way, I had a hard time trying to figure out a puzzle generator, but I eventually made one that could spit out valid puzzles. It worked so slow however I couldn't put it in the game. It took up to 30 secs to make a valid puzzle. That's why I just used pre-made puzzles in the game, to skip the wait.
Might as well also post the really horrible generator program that makes the puzzles. It BEEPs when the puzzle is generated.
- Dav
Code: (Select All) '==========
'SUDOKU-GEN.BAS v1.0
'==========
grid = 9 ' grid size is is 9x9
cells = grid * grid ' number of cells on grid
Dim cellx(grid * grid), celly(grid * grid) 'top x/y cords of cells
Dim cellx2(grid * grid), celly2(grid * grid) ' bottom x/y cords of cells
Dim Shared cellvalue(grid * grid) 'holds the cell number values
dh = _DesktopHeight * .75
size = Int(dh / grid) ' size of cells
Screen _NewImage(size * grid, size * grid, 32)
BIGFONT Int(_Height / 9)
_PrintMode _KeepBackground
Randomize Timer
redo:
'Cls
bc = 1 'counter
For col = 1 To grid
For row = 1 To grid
x = (row * size): y = (col * size)
cellx(bc) = x - size: cellx2(bc) = x ' generate x/y values
celly(bc) = y - size: celly2(bc) = y
cellvalue(bc) = 0
bc = bc + 1
Next
Next
ReDim nums(9)
For a = 1 To 9: nums(a) = a: Next
block1:
'======
GoSub Random9
cellvalue(1) = nums(1)
cellvalue(2) = nums(2)
cellvalue(3) = nums(3)
cellvalue(10) = nums(4)
cellvalue(11) = nums(5)
cellvalue(12) = nums(6)
cellvalue(19) = nums(7)
cellvalue(20) = nums(8)
cellvalue(21) = nums(9)
GoSub updateboard
block2:
'=====
GoSub Random9
cellvalue(4) = 0
cellvalue(5) = 0
cellvalue(6) = 0
cellvalue(13) = 0
cellvalue(14) = 0
cellvalue(15) = 0
cellvalue(22) = 0
cellvalue(23) = 0
cellvalue(24) = 0
cellvalue(4) = nums(1): If Conflict(4) = -1 Then GoTo block2
cellvalue(5) = nums(2): If Conflict(5) = -1 Then GoTo block2
cellvalue(6) = nums(3): If Conflict(6) = -1 Then GoTo block2
cellvalue(13) = nums(4): If Conflict(13) = -1 Then GoTo block2
cellvalue(14) = nums(5): If Conflict(14) = -1 Then GoTo block2
cellvalue(15) = nums(6): If Conflict(15) = -1 Then GoTo block2
cellvalue(22) = nums(7): If Conflict(22) = -1 Then GoTo block2
cellvalue(23) = nums(8): If Conflict(23) = -1 Then GoTo block2
cellvalue(24) = nums(9): If Conflict(24) = -1 Then GoTo block2
GoSub updateboard
block3:
'=====
GoSub Random9
cellvalue(7) = 0
cellvalue(8) = 0
cellvalue(9) = 0
cellvalue(16) = 0
cellvalue(17) = 0
cellvalue(18) = 0
cellvalue(25) = 0
cellvalue(26) = 0
cellvalue(27) = 0
cellvalue(7) = nums(1): If Conflict(7) = -1 Then GoTo block3
cellvalue(8) = nums(2): If Conflict(8) = -1 Then GoTo block3
cellvalue(9) = nums(3): If Conflict(9) = -1 Then GoTo block3
cellvalue(16) = nums(4): If Conflict(16) = -1 Then GoTo block3
cellvalue(17) = nums(5): If Conflict(17) = -1 Then GoTo block3
cellvalue(18) = nums(6): If Conflict(18) = -1 Then GoTo block3
cellvalue(25) = nums(7): If Conflict(25) = -1 Then GoTo block3
cellvalue(26) = nums(8): If Conflict(26) = -1 Then GoTo block3
cellvalue(27) = nums(9): If Conflict(27) = -1 Then GoTo block3
GoSub updateboard
block4:
'=====
GoSub Random9
cellvalue(28) = 0
cellvalue(29) = 0
cellvalue(30) = 0
cellvalue(37) = 0
cellvalue(38) = 0
cellvalue(39) = 0
cellvalue(46) = 0
cellvalue(47) = 0
cellvalue(48) = 0
cellvalue(28) = nums(1): If Conflict(28) = -1 Then GoTo block4
cellvalue(29) = nums(2): If Conflict(29) = -1 Then GoTo block4
cellvalue(30) = nums(3): If Conflict(30) = -1 Then GoTo block4
cellvalue(37) = nums(4): If Conflict(37) = -1 Then GoTo block4
cellvalue(38) = nums(5): If Conflict(38) = -1 Then GoTo block4
cellvalue(39) = nums(6): If Conflict(39) = -1 Then GoTo block4
cellvalue(46) = nums(7): If Conflict(46) = -1 Then GoTo block4
cellvalue(47) = nums(8): If Conflict(47) = -1 Then GoTo block4
cellvalue(48) = nums(9): If Conflict(48) = -1 Then GoTo block4
GoSub updateboard
block5:
'=====
GoSub Random9
cellvalue(31) = 0
cellvalue(32) = 0
cellvalue(33) = 0
cellvalue(40) = 0
cellvalue(41) = 0
cellvalue(42) = 0
cellvalue(49) = 0
cellvalue(50) = 0
cellvalue(51) = 0
cellvalue(31) = nums(1): If Conflict(31) = -1 Then GoTo block5
cellvalue(32) = nums(2): If Conflict(32) = -1 Then GoTo block5
cellvalue(33) = nums(3): If Conflict(33) = -1 Then GoTo block5
cellvalue(40) = nums(4): If Conflict(40) = -1 Then GoTo block5
cellvalue(41) = nums(5): If Conflict(41) = -1 Then GoTo block5
cellvalue(42) = nums(6): If Conflict(42) = -1 Then GoTo block5
cellvalue(49) = nums(7): If Conflict(49) = -1 Then GoTo block5
cellvalue(50) = nums(8): If Conflict(50) = -1 Then GoTo block5
cellvalue(51) = nums(9): If Conflict(51) = -1 Then GoTo block5
GoSub updateboard
block6:
'=====
GoSub Random9
cellvalue(34) = 0
cellvalue(35) = 0
cellvalue(36) = 0
cellvalue(43) = 0
cellvalue(44) = 0
cellvalue(45) = 0
cellvalue(52) = 0
cellvalue(53) = 0
cellvalue(54) = 0
cellvalue(34) = nums(1): If Conflict(34) = -1 Then GoTo block6
cellvalue(35) = nums(2): If Conflict(35) = -1 Then GoTo block6
cellvalue(36) = nums(3): If Conflict(36) = -1 Then GoTo block6
cellvalue(43) = nums(4): If Conflict(43) = -1 Then GoTo block6
cellvalue(44) = nums(5): If Conflict(44) = -1 Then GoTo block6
cellvalue(45) = nums(6): If Conflict(45) = -1 Then GoTo block6
cellvalue(52) = nums(7): If Conflict(52) = -1 Then GoTo block6
cellvalue(53) = nums(8): If Conflict(53) = -1 Then GoTo block6
cellvalue(54) = nums(9): If Conflict(54) = -1 Then GoTo block6
GoSub updateboard
block7:
'=====
GoSub Random9
cellvalue(55) = 0
cellvalue(56) = 0
cellvalue(57) = 0
cellvalue(64) = 0
cellvalue(65) = 0
cellvalue(66) = 0
cellvalue(73) = 0
cellvalue(74) = 0
cellvalue(75) = 0
cellvalue(55) = nums(1): If Conflict(55) = -1 Then GoTo block7
cellvalue(56) = nums(2): If Conflict(56) = -1 Then GoTo block7
cellvalue(57) = nums(3): If Conflict(57) = -1 Then GoTo block7
cellvalue(64) = nums(4): If Conflict(64) = -1 Then GoTo block7
cellvalue(65) = nums(5): If Conflict(65) = -1 Then GoTo block7
cellvalue(66) = nums(6): If Conflict(66) = -1 Then GoTo block7
cellvalue(73) = nums(7): If Conflict(73) = -1 Then GoTo block7
cellvalue(74) = nums(8): If Conflict(74) = -1 Then GoTo block7
cellvalue(75) = nums(9): If Conflict(75) = -1 Then GoTo block7
GoSub updateboard
block8:
'=====
GoSub Random9
cellvalue(58) = 0
cellvalue(59) = 0
cellvalue(60) = 0
cellvalue(67) = 0
cellvalue(68) = 0
cellvalue(69) = 0
cellvalue(76) = 0
cellvalue(77) = 0
cellvalue(78) = 0
cellvalue(58) = nums(1): If Conflict(58) = -1 Then GoTo block8
cellvalue(59) = nums(2): If Conflict(59) = -1 Then GoTo block8
cellvalue(60) = nums(3): If Conflict(60) = -1 Then GoTo block8
cellvalue(67) = nums(4): If Conflict(67) = -1 Then GoTo block8
cellvalue(68) = nums(5): If Conflict(68) = -1 Then GoTo block8
cellvalue(69) = nums(6): If Conflict(69) = -1 Then GoTo block8
cellvalue(76) = nums(7): If Conflict(76) = -1 Then GoTo block8
cellvalue(77) = nums(8): If Conflict(77) = -1 Then GoTo block8
cellvalue(78) = nums(9): If Conflict(78) = -1 Then GoTo block8
GoSub updateboard
block9:
'=====
GoSub Random9
cellvalue(61) = 0
cellvalue(62) = 0
cellvalue(63) = 0
cellvalue(70) = 0
cellvalue(71) = 0
cellvalue(72) = 0
cellvalue(79) = 0
cellvalue(80) = 0
cellvalue(81) = 0
cellvalue(61) = nums(1): If Conflict(61) = -1 Then GoTo block9
cellvalue(62) = nums(2): If Conflict(62) = -1 Then GoTo block9
cellvalue(63) = nums(3): If Conflict(63) = -1 Then GoTo block9
cellvalue(70) = nums(4): If Conflict(70) = -1 Then GoTo block9
cellvalue(71) = nums(5): If Conflict(71) = -1 Then GoTo block9
cellvalue(72) = nums(6): If Conflict(72) = -1 Then GoTo block9
cellvalue(79) = nums(7): If Conflict(79) = -1 Then GoTo block9
cellvalue(80) = nums(8): If Conflict(80) = -1 Then GoTo block9
cellvalue(81) = nums(9): If Conflict(81) = -1 Then GoTo block9
GoSub updateboard
Beep
Sleep 3
'clear some pieces
For c = 1 To 81
If Int(Rnd * 3) = 1 Then
'do nothing
Else
cellvalue(c) = 0
End If
Next
GoSub updateboard
Sleep
End
'=======
Random9:
'=======
rep = rep + 1
If rep > 300000 Then
rep = 0
GoTo redo
End If
'random 9 string
For b = 1 To 9
m = Int(Rnd * 9) + 1: t = nums(m)
nums(m) = nums(b): nums(b) = t
Next
Return
'==========
updateboard:
'==========
Cls , _RGB(100, 0, 0)
bc = 1
For row = 1 To grid
For col = 1 To grid
bx = cellx(bc) - (Int(_Height / 9) / 4.5)
by = celly(bc) + (Int(_Height / 9) / 14.5)
'if value not a zero...
If cellvalue(bc) <> 0 Then
'shadow
Color _RGB(0, 0, 0)
_PrintString (bx + (size * .03), by + (size * .03)), Str$(cellvalue(bc))
'if assigned puz number
'check if conflict on row or column here <<<<<
If Conflict(bc) = -1 Then
'red color
Color _RGB(255, 64, 64)
Else
Color _RGB(255, 180, 125)
End If
_PrintString (bx, by), Str$(cellvalue(bc))
End If
Line (cellx(bc), celly(bc))-(cellx2(bc), celly2(bc)), _RGB(200, 100, 50), B
bc = bc + 1
Next
Next
'draw thicker lines
tk = size * .03
Line (0, size * 3 - tk)-(_Width, size * 3 + tk + tk), _RGB(0, 0, 0), BF
Line (0, size * 3 - tk)-(_Width, size * 3 + tk), _RGB(200, 100, 50), BF
Line (0, size * 6 - tk)-(_Width, size * 6 + tk + tk), _RGB(0, 0, 0), BF
Line (0, size * 6 - tk)-(_Width, size * 6 + tk), _RGB(200, 100, 50), BF
Line (size * 3 - tk, 0)-(size * 3 + tk, _Height), _RGB(200, 100, 50), BF
Line (size * 6 - tk, 0)-(size * 6 + tk, _Height), _RGB(200, 100, 50), BF
For f = 0 To (size * .06)
Line (0 + f, 0 + f)-(_Width - f, _Height - f), _RGB(200, 100, 50), B
Next
_Display
Return
Function Conflict (num)
'this function checks rows/columns/blocks for any conflicts.
'p$ holds all the other cell numbers to compare 'num' with.
Select Case num
'first row, 01-09
Case 1: p$ = "0203040506070809101928374655647311122021"
Case 2: p$ = "0103040506070809112029384756657410121921"
Case 3: p$ = "0102040506070809122130394857667510111920"
Case 4: p$ = "0102030506070809132231404958677614152324"
Case 5: p$ = "0102030406070809142332415059687713152224"
Case 6: p$ = "0102030405070809152433425160697813142223"
Case 7: p$ = "0102030405060809162534435261707917182627"
Case 8: p$ = "0102030405060709172635445362718016182527"
Case 9: p$ = "0102030405060708182736455463728116172526"
'second row, 10-18
Case 10: p$ = "1112131415161718011928374655647302032021"
Case 11: p$ = "1012131415161718022029384756657401031921"
Case 12: p$ = "1011131415161718032130394857667501021920"
Case 13: p$ = "1011121415161718042231404958677605062324"
Case 14: p$ = "1011121315161718052332415059687704062224"
Case 15: p$ = "1011121314161718062433425160697804052223"
Case 16: p$ = "1011121314151718072534435261707908092627"
Case 17: p$ = "1011121314151618082635445362718007092527"
Case 18: p$ = "1011121314151617092736455463728107082526"
'third row, 19-27
Case 19: p$ = "2021222324252627011028374655647302031112"
Case 20: p$ = "1921222324252627021129384756657401031012"
Case 21: p$ = "1920222324252627031230394857667501021011"
Case 22: p$ = "1920212324252627041331404958677605061415"
Case 23: p$ = "1920212224252627051432415059687704061315"
Case 24: p$ = "1920212223252627061533425160697804051314"
Case 25: p$ = "1920212223242627071634435261707908091718"
Case 26: p$ = "1920212223242527081735445362718007091618"
Case 27: p$ = "1920212223242526091836455463728107081617"
'forth row,28-36
Case 28: p$ = "2930313233343536011019374655647338394748"
Case 29: p$ = "2830313233343536021120384756657437394648"
Case 30: p$ = "2829313233343536031221394857667537384647"
Case 31: p$ = "2829303233343536041322404958677641425051"
Case 32: p$ = "2829303133343536051423415059687740424951"
Case 33: p$ = "2829303132343536061524425160697840414950"
Case 34: p$ = "2829303132333536071625435261707944455354"
Case 35: p$ = "2829303132333436081726445362718043455254"
Case 36: p$ = "2829303132333435091827455463728143445253"
'fifth row,37-45
Case 37: p$ = "3839404142434445011019284655647329304748"
Case 38: p$ = "3739404142434445021120294756657428304648"
Case 39: p$ = "3738404142434445031221304857667528294647"
Case 40: p$ = "3738394142434445041322314958677632335051"
Case 41: p$ = "3738394042434445051423325059687731334951"
Case 42: p$ = "3738394041434445061524335160697831324950"
Case 43: p$ = "3738394041424445071625345261707935365354"
Case 44: p$ = "3738394041424345081726355362718034365254"
Case 45: p$ = "3738394041424344091827365463728134355253"
'sixth row,46-54
Case 46: p$ = "4748495051525354011019283755647329303839"
Case 47: p$ = "4648495051525354021120293856657428303739"
Case 48: p$ = "4647495051525354031221303957667528293738"
Case 49: p$ = "4647485051525354041322314058677632334142"
Case 50: p$ = "4647484951525354051423324159687731334042"
Case 51: p$ = "4647484950525354061524334260697831324041"
Case 52: p$ = "4647484950515354071625344361707935364445"
Case 53: p$ = "4647484950515254081726354462718034364345"
Case 54: p$ = "4647484950515253091827364563728134354344"
'seventh row, 55-63
Case 55: p$ = "5657585960616263011019283746647365667475"
Case 56: p$ = "5557585960616263021120293847657464667375"
Case 57: p$ = "5556585960616263031221303948667564657374"
Case 58: p$ = "5556575960616263041322314049677668697778"
Case 59: p$ = "5556575860616263051423324150687767697678"
Case 60: p$ = "5556575859616263061524334251697867687677"
Case 61: p$ = "5556575859606263071625344352707971728081"
Case 62: p$ = "5556575859606163081726354453718070727981"
Case 63: p$ = "5556575859606162091827364554728170717980"
'eight row, 64-72
Case 64: p$ = "6566676869707172011019283746557356577475"
Case 65: p$ = "6466676869707172021120293847567455577375"
Case 66: p$ = "6465676869707172031221303948577555567374"
Case 67: p$ = "6465666869707172041322314049587659607778"
Case 68: p$ = "6465666769707172051423324150597758607678"
Case 69: p$ = "6465666768707172061524334251607858597677"
Case 70: p$ = "6465666768697172071625344352617962638081"
Case 71: p$ = "6465666768697072081726354453628061637981"
Case 72: p$ = "6465666768697071091827364554638161627980"
'ninth row, 73-81
Case 73: p$ = "7475767778798081011019283746556456576566"
Case 74: p$ = "7375767778798081021120293847566555576466"
Case 75: p$ = "7374767778798081031221303948576655566465"
Case 76: p$ = "7374757778798081041322314049586759606869"
Case 77: p$ = "7374757678798081051423324150596858606769"
Case 78: p$ = "7374757677798081061524334251606958596768"
Case 79: p$ = "7374757677788081071625344352617062637172"
Case 80: p$ = "7374757677787981081726354453627161637072"
Case 81: p$ = "7374757677787980091827364554637261627071"
End Select
For c = 1 To Len(p$) Step 2
chk = Val(Mid$(p$, c, 2))
If cellvalue(chk) = cellvalue(num) Then Conflict = -1
Next
End Function
Sub BIGFONT (size)
'make/load another CP437 font (like QB64's built-in one)'
'This one is resizable so you can make/use larger size SCREEN font.
A$ = ""
A$ = A$ + "haIgm]0MLEMMXkS^ST\\T]lHiaboe<Nl8c71HYa3f0VPiWa9H07n5a_0bn:K"
A$ = A$ + ";#FB8;c773hBD8T42E_#C:=QBC39PSQB=DB2UhdhVBB^9=_D2EQ#Ala?JFmi"
A$ = A$ + "ejeGKNiYTV4\UNkOWcmL791Y0Iefg<NdmNWiLfWmIoO_?WkeP10H6`NP0HS["
A$ = A$ + "KMGj5l9Nf7lH0HC;3of5MAGb9ef>>V6V60Vfa[_^=_m>j[Y]NOC7PDY`?kKc"
A$ = A$ + "gd0IQB1o20VfnaO?eFkH7m=nh8TP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= C$: End If: For j = 1 To Len(B$)
If Mid$(B$, j, 1) = "#" Then
Mid$(B$, j) = "@": End If: Next
For t% = Len(B$) To 1 Step -1
B& = B& * 64 + Asc(Mid$(B$, t%)) - 48
Next: X$ = "": For t% = 1 To Len(B$) - 1
X$ = X$ + Chr$(B& And 255): B& = B& \ 256
Next: btemp$ = btemp$ + X$: Next
BASFILE$ = _Inflate$(btemp$, 25152): btemp$ = ""
_Font _LoadFont(BASFILE$, size, "memory, monospace")
End Sub
RE: Simple Sudoku puzzle (medium levels) - bplus - 06-09-2024
(06-09-2024, 02:45 AM)Dav Wrote: By the way, I had a hard time trying to figure out a puzzle generator, but I eventually made one that could spit out valid puzzles. It worked so slow however I couldn't put it in the game. It took up to 30 secs to make a valid puzzle. That's why I just used pre-made puzzles in the game, to skip the wait.
Might as well also post the really horrible generator program that makes the puzzles. It BEEPs when the puzzle is generated.
- Dav
my generator takes a long time too when attempting to make a high level difficult puzzle. i start with solved puzzle and randomly remove clues. The trick is not to remove a clue that ruins the uniquness of the solution ie a puzzle with more than one solution is bad because pure logic can't resolve the solution.
getting a solver working is key. i use it to create solved puzzles ie it solves a blank grid. then again to check randomly removed clues to make sure the solution remains unique.
RE: Simple Sudoku puzzle (medium levels) - Dav - 06-09-2024
Hmm I haven't thought of that. But you gave me a great idea for a new approach for generating different puzzles really fast, by using a solved puzzle a seed and make variations from that. I have to leave for a gig now, but when I get home I will post a new working generator that takes no time at all to make many different puzzles. I still don't know yet how to remove them numbers smartly like you mention tho (one step at a time)
- Dav
EDIT: I'll go ahead and post it before I leave. What this does is start with a pre-made solved puzzled, and then swap rows/columns/blocks with each other in a way that doesn't break the board, and it creates a completely different board. It also swaps numbers board-wide randomly. (all 1's and 5's swap places, etc).
Keep pressing a key for a new board. This is from only one pre-made puzzle. If using a small pool of puzzles it would be all a sudoku game needs.
See the MakeRandomPuzzle SUB for the method.
Code: (Select All) '==========
'SUDOKU-GEN.BAS v1.1
'==========
grid = 9 ' grid size is is 9x9
cells = grid * grid ' number of cells on grid
Dim cellx(grid * grid), celly(grid * grid) 'top x/y cords of cells
Dim cellx2(grid * grid), celly2(grid * grid) ' bottom x/y cords of cells
Dim Shared cellvalue(grid * grid) 'holds the cell number values
dh = _DesktopHeight * .75
size = Int(dh / grid) ' size of cells
Screen _NewImage(size * grid, size * grid, 32)
BIGFONT Int(_Height / 9)
_PrintMode _KeepBackground
Randomize Timer
redo:
bc = 1 'counter
For col = 1 To grid
For row = 1 To grid
x = (row * size): y = (col * size)
cellx(bc) = x - size: cellx2(bc) = x ' generate x/y values
celly(bc) = y - size: celly2(bc) = y
cellvalue(bc) = 0
bc = bc + 1
Next
Next
Do
MakeRandomPuzzle
GoSub UpdateBoard
Sleep
Loop
'==========
UpdateBoard:
'==========
Cls , _RGB(100, 0, 0)
bc = 1
For row = 1 To grid
For col = 1 To grid
bx = cellx(bc) - (Int(_Height / 9) / 4.5)
by = celly(bc) + (Int(_Height / 9) / 14.5)
'if value not a zero...
If cellvalue(bc) <> 0 Then
'shadow
Color _RGB(0, 0, 0)
_PrintString (bx + (size * .03), by + (size * .03)), Str$(cellvalue(bc))
'if assigned puz number
'check if conflict on row or column here <<<<<
If Conflict(bc) = -1 Then
'red color
Color _RGB(255, 64, 64)
Else
Color _RGB(255, 180, 125)
End If
_PrintString (bx, by), Str$(cellvalue(bc))
End If
Line (cellx(bc), celly(bc))-(cellx2(bc), celly2(bc)), _RGB(200, 100, 50), B
bc = bc + 1
Next
Next
'draw thicker lines
tk = size * .03
Line (0, size * 3 - tk)-(_Width, size * 3 + tk + tk), _RGB(0, 0, 0), BF
Line (0, size * 3 - tk)-(_Width, size * 3 + tk), _RGB(200, 100, 50), BF
Line (0, size * 6 - tk)-(_Width, size * 6 + tk + tk), _RGB(0, 0, 0), BF
Line (0, size * 6 - tk)-(_Width, size * 6 + tk), _RGB(200, 100, 50), BF
Line (size * 3 - tk, 0)-(size * 3 + tk, _Height), _RGB(200, 100, 50), BF
Line (size * 6 - tk, 0)-(size * 6 + tk, _Height), _RGB(200, 100, 50), BF
For f = 0 To (size * .06)
Line (0 + f, 0 + f)-(_Width - f, _Height - f), _RGB(200, 100, 50), B
Next
_Display
Return
Sub MakeRandomPuzzle
'start with a pre-made solved sudoku puzzle
puz$ = "416598723259743861873162495624815379791324586385679214962437158148256937537981642"
'load selected puz$ into cellvalue()
For c = 1 To 81
cellvalue(c) = Val(Mid$(puz$, c, 1))
Next
'========== swap rows
'swap top 3 rows randomly
Select Case Int(Rnd * 4) + 1
Case 1 'swap row 1 and 2
For s = 1 To 9: Swap cellvalue(s), cellvalue(s + 9): Next
Case 2 'swap row 1 and 3
For s = 1 To 9: Swap cellvalue(s), cellvalue(s + 18): Next
Case 3 'swap row 2 and 3
For s = 10 To 18: Swap cellvalue(s), cellvalue(s + 9): Next
End Select
'swap middle 3 rows randomly
Select Case Int(Rnd * 4) + 1
Case 1 'swap row 4 and 5
For s = 28 To 36: Swap cellvalue(s), cellvalue(s + 9): Next
Case 2 'swap row 4 and 6
For s = 28 To 36: Swap cellvalue(s), cellvalue(s + 18): Next
Case 3 'swap row 5 and 6
For s = 37 To 45: Swap cellvalue(s), cellvalue(s + 9): Next
End Select
'swap bottom 3 rows a few times
Select Case Int(Rnd * 4) + 1
Case 1 'swap row 7 and 8
For s = 55 To 63: Swap cellvalue(s), cellvalue(s + 9): Next
Case 2 'swap row 7 and 9
For s = 55 To 63: Swap cellvalue(s), cellvalue(s + 18): Next
Case 3 'swap row 8 and 9
For s = 64 To 72: Swap cellvalue(s), cellvalue(s + 9): Next
End Select
'============ swap columns
'swap left 3 columns
Select Case Int(Rnd * 4) + 1
Case 1 'swap column 1 and 2
For s = 1 To 73 Step 9: Swap cellvalue(s), cellvalue(s + 1): Next
Case 2 'swap column 1 and 3
For s = 1 To 73 Step 9: Swap cellvalue(s), cellvalue(s + 2): Next
Case 3 'swap column 2 and 3
For s = 2 To 74 Step 9: Swap cellvalue(s), cellvalue(s + 1): Next
End Select
'swap middle 3 columns
Select Case Int(Rnd * 4) + 1
Case 1 'swap column 4 and 5
For s = 4 To 76 Step 9: Swap cellvalue(s), cellvalue(s + 1): Next
Case 2 'swap column 4 and 6
For s = 4 To 76 Step 9: Swap cellvalue(s), cellvalue(s + 2): Next
Case 3 'swap column 5 and 6
For s = 5 To 77 Step 9: Swap cellvalue(s), cellvalue(s + 1): Next
End Select
'swap right 3 columns
Select Case Int(Rnd * 4) + 1
Case 1 'swap column 7 and 8
For s = 7 To 79 Step 9: Swap cellvalue(s), cellvalue(s + 1): Next
Case 2 'swap column 7 and 9
For s = 7 To 79 Step 9: Swap cellvalue(s), cellvalue(s + 2): Next
Case 3 'swap column 8 and 9
For s = 8 To 80 Step 9: Swap cellvalue(s), cellvalue(s + 1): Next
End Select
'====== now swap blocks of rows (3)
Select Case Int(Rnd * 4) + 1
Case 1 'swap top row of blocks with and middle row
For s = 1 To 9
Swap cellvalue(s), cellvalue(s + 27)
Swap cellvalue(s + 9), cellvalue(s + 36)
Swap cellvalue(s + 18), cellvalue(s + 45)
Next
Case 2 'swap top row of blocks with bottom row of blocks
For s = 1 To 9
Swap cellvalue(s), cellvalue(s + 54)
Swap cellvalue(s + 9), cellvalue(s + 63)
Swap cellvalue(s + 18), cellvalue(s + 72)
Next
Case 3 'swap middle row of blocks with bottom row of blocks
For s = 28 To 36
Swap cellvalue(s), cellvalue(s + 27)
Swap cellvalue(s + 9), cellvalue(s + 36)
Swap cellvalue(s + 18), cellvalue(s + 45)
Next
End Select
'====== now swap columns of blocks
Select Case Int(Rnd * 4) + 1
Case 1 'swap left block column with middle
For s = 1 To 73 Step 9
Swap cellvalue(s), cellvalue(s + 3)
Swap cellvalue(s + 1), cellvalue(s + 4)
Swap cellvalue(s + 2), cellvalue(s + 5)
Next
Case 2 'swap left block column with right
For s = 1 To 73 Step 9
Swap cellvalue(s), cellvalue(s + 6)
Swap cellvalue(s + 1), cellvalue(s + 7)
Swap cellvalue(s + 2), cellvalue(s + 8)
Next
Case 3 'swap middle block of columns withright one
For s = 4 To 76 Step 9
Swap cellvalue(s), cellvalue(s + 3)
Swap cellvalue(s + 1), cellvalue(s + 4)
Swap cellvalue(s + 2), cellvalue(s + 5)
Next
End Select
'=========== swap some numbers..
Select Case Int(Rnd * 5) + 1
Case 1 'swap 1's and 5's
For c = 1 To 81
Select Case cellvalue(c)
Case 1: cellvalue(c) = 5
Case 5: cellvalue(c) = 1
End Select
Next
Case 2 'swap 2's and 6's
For c = 1 To 81
Select Case cellvalue(c)
Case 2: cellvalue(c) = 6
Case 6: cellvalue(c) = 2
End Select
Next
Case 3 'swap 3's and 7's
For c = 1 To 81
Select Case cellvalue(c)
Case 3: cellvalue(c) = 7
Case 7: cellvalue(c) = 3
End Select
Next
Case 4 'swap 4's and 8's
For c = 1 To 81
Select Case cellvalue(c)
Case 4: cellvalue(c) = 8
Case 8: cellvalue(c) = 4
End Select
Next
Case 5 'swap 9's and 1's
For c = 1 To 81
Select Case cellvalue(c)
Case 1: cellvalue(c) = 9
Case 9: cellvalue(c) = 1
End Select
Next
End Select
End Sub
Function Conflict (num)
'this function checks rows/columns/blocks for any conflicts.
'p$ holds all the other cell numbers to compare 'num' with.
Select Case num
'first row, 01-09
Case 1: p$ = "0203040506070809101928374655647311122021"
Case 2: p$ = "0103040506070809112029384756657410121921"
Case 3: p$ = "0102040506070809122130394857667510111920"
Case 4: p$ = "0102030506070809132231404958677614152324"
Case 5: p$ = "0102030406070809142332415059687713152224"
Case 6: p$ = "0102030405070809152433425160697813142223"
Case 7: p$ = "0102030405060809162534435261707917182627"
Case 8: p$ = "0102030405060709172635445362718016182527"
Case 9: p$ = "0102030405060708182736455463728116172526"
'second row, 10-18
Case 10: p$ = "1112131415161718011928374655647302032021"
Case 11: p$ = "1012131415161718022029384756657401031921"
Case 12: p$ = "1011131415161718032130394857667501021920"
Case 13: p$ = "1011121415161718042231404958677605062324"
Case 14: p$ = "1011121315161718052332415059687704062224"
Case 15: p$ = "1011121314161718062433425160697804052223"
Case 16: p$ = "1011121314151718072534435261707908092627"
Case 17: p$ = "1011121314151618082635445362718007092527"
Case 18: p$ = "1011121314151617092736455463728107082526"
'third row, 19-27
Case 19: p$ = "2021222324252627011028374655647302031112"
Case 20: p$ = "1921222324252627021129384756657401031012"
Case 21: p$ = "1920222324252627031230394857667501021011"
Case 22: p$ = "1920212324252627041331404958677605061415"
Case 23: p$ = "1920212224252627051432415059687704061315"
Case 24: p$ = "1920212223252627061533425160697804051314"
Case 25: p$ = "1920212223242627071634435261707908091718"
Case 26: p$ = "1920212223242527081735445362718007091618"
Case 27: p$ = "1920212223242526091836455463728107081617"
'forth row,28-36
Case 28: p$ = "2930313233343536011019374655647338394748"
Case 29: p$ = "2830313233343536021120384756657437394648"
Case 30: p$ = "2829313233343536031221394857667537384647"
Case 31: p$ = "2829303233343536041322404958677641425051"
Case 32: p$ = "2829303133343536051423415059687740424951"
Case 33: p$ = "2829303132343536061524425160697840414950"
Case 34: p$ = "2829303132333536071625435261707944455354"
Case 35: p$ = "2829303132333436081726445362718043455254"
Case 36: p$ = "2829303132333435091827455463728143445253"
'fifth row,37-45
Case 37: p$ = "3839404142434445011019284655647329304748"
Case 38: p$ = "3739404142434445021120294756657428304648"
Case 39: p$ = "3738404142434445031221304857667528294647"
Case 40: p$ = "3738394142434445041322314958677632335051"
Case 41: p$ = "3738394042434445051423325059687731334951"
Case 42: p$ = "3738394041434445061524335160697831324950"
Case 43: p$ = "3738394041424445071625345261707935365354"
Case 44: p$ = "3738394041424345081726355362718034365254"
Case 45: p$ = "3738394041424344091827365463728134355253"
'sixth row,46-54
Case 46: p$ = "4748495051525354011019283755647329303839"
Case 47: p$ = "4648495051525354021120293856657428303739"
Case 48: p$ = "4647495051525354031221303957667528293738"
Case 49: p$ = "4647485051525354041322314058677632334142"
Case 50: p$ = "4647484951525354051423324159687731334042"
Case 51: p$ = "4647484950525354061524334260697831324041"
Case 52: p$ = "4647484950515354071625344361707935364445"
Case 53: p$ = "4647484950515254081726354462718034364345"
Case 54: p$ = "4647484950515253091827364563728134354344"
'seventh row, 55-63
Case 55: p$ = "5657585960616263011019283746647365667475"
Case 56: p$ = "5557585960616263021120293847657464667375"
Case 57: p$ = "5556585960616263031221303948667564657374"
Case 58: p$ = "5556575960616263041322314049677668697778"
Case 59: p$ = "5556575860616263051423324150687767697678"
Case 60: p$ = "5556575859616263061524334251697867687677"
Case 61: p$ = "5556575859606263071625344352707971728081"
Case 62: p$ = "5556575859606163081726354453718070727981"
Case 63: p$ = "5556575859606162091827364554728170717980"
'eight row, 64-72
Case 64: p$ = "6566676869707172011019283746557356577475"
Case 65: p$ = "6466676869707172021120293847567455577375"
Case 66: p$ = "6465676869707172031221303948577555567374"
Case 67: p$ = "6465666869707172041322314049587659607778"
Case 68: p$ = "6465666769707172051423324150597758607678"
Case 69: p$ = "6465666768707172061524334251607858597677"
Case 70: p$ = "6465666768697172071625344352617962638081"
Case 71: p$ = "6465666768697072081726354453628061637981"
Case 72: p$ = "6465666768697071091827364554638161627980"
'ninth row, 73-81
Case 73: p$ = "7475767778798081011019283746556456576566"
Case 74: p$ = "7375767778798081021120293847566555576466"
Case 75: p$ = "7374767778798081031221303948576655566465"
Case 76: p$ = "7374757778798081041322314049586759606869"
Case 77: p$ = "7374757678798081051423324150596858606769"
Case 78: p$ = "7374757677798081061524334251606958596768"
Case 79: p$ = "7374757677788081071625344352617062637172"
Case 80: p$ = "7374757677787981081726354453627161637072"
Case 81: p$ = "7374757677787980091827364554637261627071"
End Select
For c = 1 To Len(p$) Step 2
chk = Val(Mid$(p$, c, 2))
If cellvalue(chk) = cellvalue(num) Then Conflict = -1
Next
End Function
Sub BIGFONT (size)
'make/load another CP437 font (like QB64's built-in one)'
'This one is resizable so you can make/use larger size SCREEN font.
A$ = ""
A$ = A$ + "haIgm]0MLEMMXkS^ST\\T]lHiaboe<Nl8c71HYa3f0VPiWa9H07n5a_0bn:K"
A$ = A$ + ";#FB8;c773hBD8T42E_#C:=QBC39PSQB=DB2UhdhVBB^9=_D2EQ#Ala?JFmi"
A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9\f]_cMX2EM>C_cAIOa=ehScNbHoGSl3nVg6Mdooo4noEAM%%h1"
btemp$ = ""
For i& = 1 To Len(A$) Step 4: B$ = Mid$(A$, i&, 4)
If InStr(1, B$, "%") Then
For C% = 1 To Len(B$): F$ = Mid$(B$, C%, 1)
If F$ <> "%" Then C$ = C$ + F$
Next: B$ = C$: End If: For j = 1 To Len(B$)
If Mid$(B$, j, 1) = "#" Then
Mid$(B$, j) = "@": End If: Next
For t% = Len(B$) To 1 Step -1
B& = B& * 64 + Asc(Mid$(B$, t%)) - 48
Next: X$ = "": For t% = 1 To Len(B$) - 1
X$ = X$ + Chr$(B& And 255): B& = B& \ 256
Next: btemp$ = btemp$ + X$: Next
BASFILE$ = _Inflate$(btemp$, 25152): btemp$ = ""
_Font _LoadFont(BASFILE$, size, "memory, monospace")
End Sub
RE: Simple Sudoku puzzle (updated with 500 puzzles) - Dav - 06-10-2024
I've updated the game with a puzzle generator using the randomizing techniques shared above. It generates 500 different puzzles when the game starts using a defined RANDOMIZE seed so the puzzle #'s are the same every time the game starts (like puzzle #300 will be the exact same puzzle next time you start the game).
These are more EASY level puzzles. You can change that by playiing with the RND value on line#628.
Going to add game saving next, so solved puzzles will be remembered and you can keep game progress.
Have fun.
- Dav
RE: Simple Sudoku puzzle (updated with 500 puzzles) - Dav - 06-12-2024
Updated the game once more. Finished it up.
Now the game progress is saved to a sudoku.dat file in the current directory. You can continue your puzzle solving where you left off. Previously solved puzzles are saved as well. I think this will be the last update for a while - the game plays as I envisioned it.
- Dav
|