Topic: Sudoku WarJ style (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=33127" title="Pages that link to Topic: Sudoku WarJ style (Page 1 of 1)" rel="nofollow" >Topic: Sudoku WarJ style <span class="small">(Page 1 of 1)</span>\

 
warjournal
Maniac (V) Mad Scientist

From:
Insane since: Aug 2000

posted posted 04-03-2016 21:09

Got to thinking about sudoku some months ago. Not creating a playable puzzle, but just the solved soduku. There is something about chaos with constraints. Read how other people do it and it was all boring with no real insight.

I started staring at sudoku puzzles looking for patterns. I finally found one that I hadn't read about. It is a bit complex. But then I reduced it by using order. Once I started with order, it became ridiculously easy to add some chaos. Start with perfect order. Seed the chaos just a tad with a very simple transform. Then, using a variation of the first transform, get crazy with the Cheese Whiz.

I can create a base3 sudoku in approximately 0.02 seconds . Base8 takes, on average, 1.3 seconds. And base16 takes me just under 3 minutes.

Here is a corner of the starting point for base8:

code:
00 01 02 03 04 05 06 07  38 39 3a 3b 3c 3d 3e 3f
08 09 0a 0b 0c 0d 0e 0f  00 01 02 03 04 05 06 07
10 11 12 13 14 15 16 17  08 09 0a 0b 0c 0d 0e 0f
18 19 1a 1b 1c 1d 1e 1f  10 11 12 13 14 15 16 17
20 21 22 23 24 25 26 27  18 19 1a 1b 1c 1d 1e 1f
28 29 2a 2b 2c 2d 2e 2f  20 21 22 23 24 25 26 27
30 31 32 33 34 35 36 37  28 29 2a 2b 2c 2d 2e 2f
38 39 3a 3b 3c 3d 3e 3f  30 31 32 33 34 35 36 37

07 00 01 02 03 04 05 06  3f 38 39 3a 3b 3c 3d 3e
0f 08 09 0a 0b 0c 0d 0e  07 00 01 02 03 04 05 06
17 10 11 12 13 14 15 16  0f 08 09 0a 0b 0c 0d 0e
1f 18 19 1a 1b 1c 1d 1e  17 10 11 12 13 14 15 16
27 20 21 22 23 24 25 26  1f 18 19 1a 1b 1c 1d 1e
2f 28 29 2a 2b 2c 2d 2e  27 20 21 22 23 24 25 26
37 30 31 32 33 34 35 36  2f 28 29 2a 2b 2c 2d 2e
3f 38 39 3a 3b 3c 3d 3e  37 30 31 32 33 34 35 36



Fairly easy to see the starting pattern, yes?

Then, using two simple transforms, one to seed the other, I get this:

code:
20 2a 26 23 01 21 22 34  08 19 1e 2b 00 3e 2f 1f
0d 0c 2e 1b 08 29 0a 0f  04 27 22 13 1c 05 26 07
10 37 14 36 12 31 13 15  18 09 02 1b 0c 0d 06 2d
38 3d 39 0b 3f 3c 1a 18  14 11 15 03 17 16 10 32
02 3b 32 3e 04 05 24 1f  1a 3a 38 3f 35 3d 3c 25
2f 06 1e 27 2c 09 2b 07  30 01 21 36 24 23 2e 33
30 11 00 03 17 33 16 35  28 29 0e 0b 2c 1d 0a 0f
28 25 0e 19 3a 1d 1c 2d  20 31 2a 37 39 34 12 3b

13 24 01 02 1c 34 25 06  1f 10 39 12 3b 0a 31 1a
0c 0b 0d 3a 0f 28 09 1a  05 07 03 00 06 04 01 3e
33 22 11 2a 00 1b 35 16  0e 1e 29 08 09 15 1d 14
39 20 21 14 07 17 1d 3e  3f 18 16 1c 37 0c 25 2a
27 36 3f 30 03 04 3d 26  21 38 19 3c 1b 3a 35 22
2e 2d 2f 0a 29 08 2c 2b  13 20 23 27 26 24 11 02
23 18 15 12 32 10 37 31  2d 34 2f 2e 0f 30 0d 0b
19 1f 3c 1e 3b 38 05 0e  17 28 3d 32 33 2c 2b 36



In this example, I have not used any row or column swaps in either the cells or blocks. Not even a remap of values. At a glance, base8 isn't the greatest visual example because of the second nibble. You can see a bunch of leading 2's in a row, but only half of the 2's are significant, so to speak. Um, the range is 00-3f and the nibble on the left can be tricksy on the eyeballs. Know what I mean?

That is straight-up WarJ style.

Base16 sudoku. In under 3 minutes. Without any cheap tricks. Or back-tracking. Wicked easy.
Kekeke.

(Edited by warjournal on 04-03-2016 21:10)

warjournal
Maniac (V) Mad Scientist

From:
Insane since: Aug 2000

posted posted 04-04-2016 03:25

I lied. A base3 sudo takes me approx 0.002 seconds. Of the two transforms that I'm using, base3 requires only 1 round of one of the transforms. Much smaller data set and only one trans.

I changed the base of the numbering system to base of the puzzle. Here is a better view of base8:

code:
16 26 61 40 44 25 60 12  63 01 42 24 10 36 21 17  46 50 51 05 27 55 15 07
45 10 71 27 54 65 36 41  37 31 52 33 44 35 46 30  25 40 42 23 73 21 61 04
57 56 00 63 14 15 51 50  47 41 02 53 64 55 06 27  71 24 03 72 34 13 30 37
30 31 20 73 34 75 42 66  60 56 12 03 04 65 25 57  10 14 33 22 47 11 32 41
70 72 22 33 74 46 07 17  50 62 61 43 20 15 51 40  54 53 36 76 52 77 26 75
23 04 32 47 03 05 02 06  72 71 74 73 54 75 70 77  62 66 67 60 63 45 56 64
11 01 52 37 64 35 76 77  00 26 13 22 34 45 66 67  31 70 57 43 74 65 12 16
24 43 62 53 21 55 67 13  11 14 32 23 76 05 16 07  01 02 00 17 44 35 06 20

72 77 73 45 61 54 31 36  57 07 51 34 53 20 35 16  74 10 47 44 23 42 25 76
63 15 33 06 17 24 13 40  05 32 25 12 30 37 76 43  26 71 20 34 11 31 07 27
56 55 27 12 57 14 50 51  46 11 21 52 03 64 01 47  32 36 02 62 17 75 35 30
47 60 37 32 11 04 46 65  23 55 41 02 27 74 50 36  15 33 72 66 51 03 45 56
25 30 43 70 62 03 71 64  24 42 60 13 61 63 15 26  50 22 12 16 53 14 05 57
44 05 02 00 01 07 66 76  77 40 71 72 75 14 73 56  60 61 65 37 67 04 46 63
10 42 23 22 41 74 35 26  04 65 31 62 33 67 00 06  70 77 21 52 43 54 64 40
34 20 53 52 67 21 75 16  10 70 22 44 66 54 17 45  00 55 73 41 01 24 13 06



The entirety of the above took 3.535 seconds.

Now that I've got this coded (parametrically to boot), having lots of fun messing with the inters just to see how distribution is affected.

Anybody want a base16 CSV in their e-mail?

Tyberius Prime
Maniac (V) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 04-05-2016 16:36

I don't get it. Why are there numbers above 15 (or 16...) in your 'base16' sudoku? Why is your last example not square?

warjournal
Maniac (V) Mad Scientist

From:
Insane since: Aug 2000

posted posted 04-06-2016 01:41

The ranges are different because I just changed the bases of the numbering. The first base8 example uses regular hexadecimal. In the last example, I changed the numbering system to base8.

code:
00, 01, 02, 03, 04, 05, 06, 07
10, 11, 12, 13, 14, 15, 16, 17
...
70, 71, 72, 73, 74, 75, 76, 77



I changed the base of the numbering system to match the base of the sudoku. For me, it makes it easier to see certain things in the sea of numbers. I was using regular hex for everything, but it was getting a little confusing mixing bases the way I was.

I'm starting to get the hang of the inters and the distribution that I want. For base16, 6 minutes not enough time to really mix things up - the distribution clusters are still too easy spot. I think my sweetness will be in the 10-15 minute range. Then set up one of my old machines to spit out nums for a few weeks. Fill a few DVDs or something. You know, because it would be an awesome ice breaker at a party. Nerdy chics will dig it. Bow-chicka-bow-bow

NoJive
Maniac (V) Inmate

From: The Land of one Headlight on.
Insane since: May 2001

posted posted 04-06-2016 08:10
quote:
Nerdy chics will dig it.

I knew there was a valid reason for all this.....uhhhh chaos! -_Q

___________________________________________________________________________
Sometimes I sits & Think -Sometimes I just sits.

Tyberius Prime
Maniac (V) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 04-07-2016 11:40

still don't get why there's '15' in a base8 sudoku that should only have numbers from 1...8?

warjournal
Maniac (V) Mad Scientist

From:
Insane since: Aug 2000

posted posted 04-07-2016 20:15

Okay, base8 uses the digits 0-7 (or 1-8 if you prefer). But there are two place values. Yes?

I've given up on time. Now I'm all about the interations no matter how long they take. All three of my machines crunching all night and spitting out CSV files. Set them in loops just waiting to be broken at my leisure.

code:
while 1==1:
   do_my_bidding()



On the older machines, 300 inters takes about 5 hours. This gives me almost acceptable distribution.

Get them done fast and use tricks to obfuscate the crappy distro? Or explore until every knook-n-cranny is understood on a very explicit level?

Suho1004
Maniac (V) Mad Librarian

From: Seoul, Korea
Insane since: Apr 2002

posted posted 04-22-2016 07:24

I don't fully understand this, but it looks cool... and I would probably go the nook-and-cranny route.


___________________________
Suho: www.liminality.org | Cell 270 | Sig Rotator | the Fellowship of Sup

warjournal
Maniac (V) Mad Scientist

From:
Insane since: Aug 2000

posted posted 04-23-2016 16:26

Here is some hard coding for base3 done lazy baboon style. This code uses the first transform that I use. At such a small size, only one interation of the first transform is all that is needed. In this case, less chaos is way much better by a way lot.

I've made lots of progress for bigger bases, but for later. Until then, this code should keep you busy.

code:
#!/usr/bin/env python
import random

# My code fu is lazy baboon, and it is the best!

# the data structure is 4d instead of 2d
# state[block_y][block_x][cell_y][cell_x]
#  mask[block_y}[block_x][cell_y][cell_x]

def scanf1x(bx):

	pairs=[]

	for cy in range(3):
		for p in lpairs:
			fbit=1
			for by in range(3):
				f0=mask[by][bx][cy][p[0]]
				f1=mask[by][bx][cy][p[1]]
				fbit=fbit&f0&f1
			if fbit:
				pairs.append([bx,cy,p[0],p[1]])

	return pairs


def scanf1y(by):

	pairs=[]

	for cx in range(3):
		for p in lpairs:
			fbit=1
			for bx in range(3):
				f0=mask[by][bx][p[0]][cx]
				f1=mask[by][bx][p[1]][cx]
				fbit=fbit&f0&f1
			if fbit:
				pairs.append([by,cx,p[0],p[1]])

	return pairs


def swapf1x(bx,cy,p0x,p1x):

	for by in range(3):

		temp0=state[by][bx][cy][p0x]
		temp1=state[by][bx][cy][p1x]

		state[by][bx][cy][p0x]=temp1
		state[by][bx][cy][p1x]=temp0

		mask[by][bx][cy][p0x]=0
		mask[by][bx][cy][p1x]=0

	return


def swapf1y(by,cx,p0y,p1y):

	for bx in range(3):

		temp0=state[by][bx][p0y][cx]
		temp1=state[by][bx][p1y][cx]

		state[by][bx][p0y][cx]=temp1
		state[by][bx][p1y][cx]=temp0

		mask[by][bx][p0y][cx]=0
		mask[by][bx][p1y][cx]=0


	return

# lazy baboon main

# globals, some are constants and some are not

state=[[[[0,1,2],[3,4,5],[6,7,8]],[[6,7,8],[0,1,2],[3,4,5]],[[3,4,5],[6,7,8],[0,1,2]]],
       [[[2,0,1],[5,3,4],[8,6,7]],[[8,6,7],[2,0,1],[5,3,4]],[[5,3,4],[8,6,7],[2,0,1]]],
       [[[1,2,0],[4,5,3],[7,8,6]],[[7,8,6],[1,2,0],[4,5,3]],[[4,5,3],[7,8,6],[1,2,0]]]]

mask=[[[[1,1,1],[1,1,1],[1,1,1]],[[1,1,1],[1,1,1],[1,1,1]],[[1,1,1],[1,1,1],[1,1,1]]],
      [[[1,1,1],[1,1,1],[1,1,1]],[[1,1,1],[1,1,1],[1,1,1]],[[1,1,1],[1,1,1],[1,1,1]]],
      [[[1,1,1],[1,1,1],[1,1,1]],[[1,1,1],[1,1,1],[1,1,1]],[[1,1,1],[1,1,1],[1,1,1]]]]

lpairs=[[0,1],[0,2],[1,2]]

remap=['1','2','3','4','5','6','7','8','9']
random.shuffle(remap)

# seed the chaos
# vertical and horizontal
# once each is all that is needed

for i in range(3):

	rlist=scanf1x(i)
	random.shuffle(rlist)
	swapf1x(rlist[0][0],rlist[0][1],rlist[0][2],rlist[0][3])

	rlist=scanf1y(i)
	random.shuffle(rlist)
	swapf1y(rlist[0][0],rlist[0][1],rlist[0][2],rlist[0][3])

# output nested a bit deep, but it sure is pretty

cout=''
print('')
for d in range(3):
	for c in range(3):
		for b in range(3):
			for a in range(3):
				cout=cout+' '+remap[state[d][b][c][a]]
			cout=cout+' '
		cout=cout+'\n'
	cout=cout+'\n'
print(cout)

warjournal
Maniac (V) Mad Scientist

From:
Insane since: Aug 2000

posted posted 04-23-2016 16:33

Two quick notes.

I don't care what you do with the above code. Smack it up, flip it, rub it down. It's all good.

And, when it comes to sudoku, back-tracking is for suckahs.

warjournal
Maniac (V) Mad Scientist

From:
Insane since: Aug 2000

posted posted 05-11-2016 16:01

I've done it. I've bloody cussing done it.
I just generated a base16 sudoku in less than 4 seconds.
The other day, I saw the pattern in its entirety.
I understand it and I can manipulate it on several levels.

Pillars of Heaven?
Consider 'em shaken.

Still so much work to do.

warjournal
Maniac (V) Mad Scientist

From:
Insane since: Aug 2000

posted posted 05-13-2016 02:56

Just because it's funny.
0.002742 seconds

code:
he/2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pUyMV CFwtQemZ fK27sAW0 +uxkHiEg joqS31aT dYz/hNn4 

2KZafSeh zYTrdR1U 6O0nL/AQ PcI9lv5H qoVEjkyG wF4MCpN3 xuBm+tJs D8gWX7ib 
Eq4j87HJ WDVXO/se rzZdcvGi n6gLFph1 mxI+KSQN 9PTlutbA Mw0CokU5 a2BfYR3y 
ndxgusvy Ml20Khti mCDI8bk1 E+z4YUSA rXwZF3/J aj6BOQ75 WfPVcHRN 9LqToGpe 
3/0NYCMw Gp4ycjEq htBeFfa2 bkViuXWD HRT58l9P USZ1odrz Q7gAKLn6 svIJO+mx 
rVlD5kGc 9g+6J7bu MTjPyRUo m0fwe/QK WBL2AtsO EIXxivH8 a4dq1p3Y nZCzNShF 
mQOABpL6 a3FNZkCw WsuJgS+x rGoyT7jq MUY14vdz nhKe0Rf2 9b8iI/XD EHc5VtlP 
9+T1Ftbz mfI5oSQP EX4NK7Hw adBJ8R3x nCgicphD WLVyY/sq rlZeOvG2 Mj0AukU6 
iIXPoRUW ABLx8vHn 5VlqYp39 NZC2OtsM e0f6u7ba Jg+DckGm yTjzFShE 14dwK/Qr 

02CeaYht 4zj1rcUS B6fAnFQ7 VPX59uHR TqlyE8Gp ZwdNMo3/ gxLJmKsv ID+iWObk 
yTdEDORs iIlW6Fvh 14CrPupb AB+nwotU JgXm2Y73 5Vj9xKkQ NZfMq8SH e0Lazc/G 
Arg+xvuG N90f2tKb JMIXDk8U ym4dzSYQ 1WZCw/Fs eEBL67OH iaVlPRc3 5nTjqpoh 
/Ff3zMNZ podGPEyT tKLhwae0 k8lbxWiI RcjHD95V SYCUqr14 7O+Q2nAB vuXs6mJg 
1l9IH8pP 5+mBsOkx NjEVGcSq JfaZhF72 iLn0QKv6 yXWgbuRD edrTUo/z ACM43Ytw 
J76QLonB e/w3C8MZ ivxs+Ymg 1pqGjOET NSzUdur4 At2hfca0 5kDbXFWI yRPHlK9V 
5mjUwKk4 JaXHqY7V yWd32ORZ erLsDc/g AM+bPotI inlGzFvT 19Ch6up0 NEfQx8SB 
bXWVqcSi QLngDuRA Hl9Tzo/5 3CM06KvN hfaBxOke s+mIP8pJ GjE4wYty UdrZ2F71 

Ktwf0Uae YSqd4Hr1 O72LB3nA cRDlVs95 opPjTbEy F/zCZGMN uv6+ghmJ 8kxXIQWi 
jozTkQ5m X8PI73Ja dYw4RsyW LOxB/Ger +uDgtUAM lcqVvhin CF2Zpb19 fK60SHNE 
L4uxvJsE CVK2tehW +Z8Dkibr jgYzS1Un dIFw/N3m fTO67AQ9 X0cPR5HM lBoqpyGa 
N32MSZCF yGzERTjo eh6a/0fK ibPWvIX8 5Hq9kVlc 1Uwrp4dY AQxntBLO JsDm7g+u 
dPV89byR lxgOmQiv CqTcEH1p +20Fa3At X6BKnhJ7 jDIuWs5k fz4orGNS LwZYMUe/ 
+A7n6GBO fN/MwbZF XJvmxUgu dypEqQTo C1Srzs4Y Leta2H0K likWD3I8 j5R9PhVc 
lgqr/hiY +0D9pUAc jIzMtQ5F f46mkHNu LZxWRGe8 XBPES3Jo dVwa7syK CT2nvb1O 
WDIcpH1X n6Buks5L 9PVoSGNl MwZK7hJC a20OvQif mxg8Rby+ EqTY/Uej rz4Ft3Ad 

afNth4K2 rdySUVYz nLe7QZO6 9liRHgcP Ej5pGIoq MC1/3TFw m+Avs0ux WXJkbB8D 
pE1GXBPu kW5bLZxK SrNUlgq8 7nJQCT2Y vmisf46F R9yH+0DO /Me3jIzc taAhdVwo 
7UmJ+xgo /Haef208 v3WiXDIY psr1dz4O SbMNCwZu tGnAL6Bc kh95lPVF RQEyjqTK 
wZeFd3/M qT1olGpE 20AKChta DI58+bkW PVycXHR9 z4NYjUSr 6BJOfQ7n xgiuLsvm 
S5HWcIql RJsnuBD+ /yG9oVzj vehMKZ6f kAQaO0xL pibm8gPX t1UEYTwd 7N3rF42C 
v6LOATQn twCFNI3M kx+uJ4sm SqjoyBGE /zdY1gUr 72fKeVha RDX8iZbW pPlc50H9 
RsyYC0Dr vhicj469 pb1FfB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cIWDbCki oV9PHfR5 
cvGzMfI1 utbPEdB5 okUwaLVN KSQxWlZJ O/sD9j0i 87HqrCgy YR32n+Te Fph6mX4A 
Dbk5El48 6Q7JW+VO PHRyrjZc w3/enfgF 2htAmLIK xsvi9XTu qGp1Md0o zUSNaCBY

warjournal
Maniac (V) Mad Scientist

From:
Insane since: Aug 2000

posted posted 05-25-2016 19:01

http://sudoku.jaderat.com/

Heh.
Just getting started, ya'll.

warjournal
Maniac (V) Mad Scientist

From:
Insane since: Aug 2000

posted posted 05-30-2016 21:06

Here is one of the base8 CSV files in the sample pack.
My HTML/CSS is very rusty, so beer with me on that.


http://sudoku.jaderat.com/base8.html

Grab the source, play with the formatting, print a poster, take of picture of it hanging on your wall, and post it.
While you are at it, print a second copy and take some white correction fluid to it. That would be amazing.

warjournal
Maniac (V) Mad Scientist

From:
Insane since: Aug 2000

posted posted 07-29-2016 15:12

I promised myself I wouldn't get caught up in doing hide/reveal.
But the pull is too great for me to resist.
I only wanted to dominate the first half, which I did.
But now the second half is calling.

There is only 1 solution.
Why is there only 1 solution?

code:
+---------+---------+---------+---------+
 | . . . D | E . G . | . . K . | M . . P |
 | . N . . | . . . D | . . G H | . J K . |
 | . . K . | . N O . | A B . . | . . G . |
 | E F . . | I . . . | . . . . | A . . D |
 +---------+---------+---------+---------+
 | . A . . | . . F . | L . . . | P . . O |
 | . . . . | . . . . | . E F . | L . . K |
 | . . J K | . . . . | . A . C | . E F . |
 | H . . G | . I J . | . . . O | . . B . |
 +---------+---------+---------+---------+
 | C . A . | G H E . | . L . J | . . . N |
 | . . M N | C . A . | . . . . | . . . . |
 | . L . J | . . . N | C . . . | . . . F |
 | . H . . | . L . J | O P M . | . . . B |
 +---------+---------+---------+---------+
 | . . D . | . . . E | J K . . | . . P . |
 | N O . . | B . D A | F . H . | . . . I |
 | . . . I | N . . M | B C . . | . G H . |
 | . . . E | . . . . | . . P . | . C . . |
 +---------+---------+---------+---------+



What is the minimum?
How to achieve minimum in and elegant way?

warjournal
Maniac (V) Mad Scientist

From:
Insane since: Aug 2000

posted posted 07-30-2016 15:56

Make some observations.
Try to work out the rules.
See if they apply to higher base puzzles.

code:
+-----+-----+
 | . B | . . |
 | C D | . . |
 +-----+-----+
 | . . | D . |
 | . . | . A |
 +-----+-----+
 
 +-----+-----+
 | . B | C . |
 | . . | . . |
 +-----+-----+
 | . . | . . |
 | D . | . A |
 +-----+-----+
 
 +-----+-----+
 | A . | . . |
 | . . | . B |
 +-----+-----+
 | . . | . C |
 | . C | B . |
 +-----+-----+

 +-----+-----+
 | . . | C . |
 | . . | . B |
 +-----+-----+
 | B . | . . |
 | . C | . A |
 +-----+-----+

warjournal
Maniac (V) Mad Scientist

From:
Insane since: Aug 2000

posted posted 11-03-2016 00:33

I'm still at it. Decided to go back and completely re-write my base
engine. Noticed a few things, thought it up, and fought with Python
trying to get it to do things the way I wanted them done.

More patterns. Trying to break them. Ran around in circles. Even
came across two logic bombs. Gotta love legit logic bombs.

Turns out that I have to put patterns in order to break them. Who
knew? With everything re-written to have patterns all over the place,
my final step is to break all of them in one go using the highest
possible frequency.

Here is an example output from previous hard code example:

code:
4 2 3  1 8 9  7 5 6
1 6 5  7 2 3  4 9 8
7 8 9  6 5 4  1 2 3

3 7 2  9 4 8  6 1 5
6 5 4  3 1 2  9 8 7
9 1 8  5 7 6  3 4 2

5 3 1  2 9 7  8 6 4
2 4 6  8 3 1  5 7 9
8 9 7  4 6 5  2 3 1



While it is a good example of a different way to make a sudoku grid,
it is absolutely replete with the patterns that I have been trying
to break.

For example, look at the digits 1,2, and 3 in each block. It shouldn't
be too difficult to see the pattern that they form in the vertical
columns (--in each vertical block).

And here is an example of my re-written code with high-frequency
combo-breaker:

code:
6 3 1  8 9 2  4 7 5
5 9 4  1 7 3  6 8 2
7 2 8  4 6 5  9 3 1

4 5 3  2 1 9  7 6 8
9 7 6  3 5 8  2 1 4
8 1 2  7 4 6  3 5 9

2 6 7  5 8 4  1 9 3
1 4 5  9 3 7  8 2 6
3 8 9  6 2 1  5 4 7



Check out the digits 1, 2, and 3 in each block. The vertical pattern
no longer exists. As a matter of fact, the other patterns that I
have been playing with no longer exist, either.

I still have a few more things to work out. The big thing on my mind
right now is how well this high-frequency attack works for higher bases. I
did a few distribution tests, but I'm still not sure how viable it
is when things start to get bigger. I *might* have to lower the frequency
shuffle just a tad, and that will be a coding nightmare.

So much work to do.

Oh, and I have found a fractal pattern. Too complex for me to
be able to play with right now. I can find it, but I have no
idea how to manipulate it.

Still so much work to do.
Indeed.

warjournal
Maniac (V) Mad Scientist

From:
Insane since: Aug 2000

posted posted 11-06-2016 14:20

Was thinking about the fractal thing that I can see in base(3) sudoku grids. I now know
it's nature. It is a function of probability. The probability of seeing a fractal pattern are
damn high. Instead of trying to work with the fractal pattern, I'm taking it into the
realm of probability where the fractal pattern springs from. I've already gotten my
base shuffle engine written and it damn good working order. But it is going to take some
time to code the sub-set extractions.

Okay, so apparent fractal pattern. Easy to see in base(3). As the base goes up, so does
the complexity of the pattern. I had worked out how to recurse the complexity. Once I
saw the rules in the rising complexity/recursion, I was able to reduce it down to a very
simple and specific form of shuffling.

So, in a way of celebrating, I'm tossing out some exercise code. Lots of fun to be had
when you start swapping values around in bgrid.

code:
#!/usr/bin/env python

# this is the base
# see what happend when
# you swap some of the
# values around
bgrid=[[0,1,2],
       [3,4,5],
       [6,7,8]]

# this holds the base(3) bits
# for example: 5=[1,2]
#              1*3+2=5
sgrid=[[0,0,0],
       [0,0,0],
       [0,0,0]]

# this is the final output grid
# once the bits are moduloed
state=[[0,0,0,0,0,0,0,0,0],
       [0,0,0,0,0,0,0,0,0],
       [0,0,0,0,0,0,0,0,0],
       [0,0,0,0,0,0,0,0,0],
       [0,0,0,0,0,0,0,0,0],
       [0,0,0,0,0,0,0,0,0],
       [0,0,0,0,0,0,0,0,0],
       [0,0,0,0,0,0,0,0,0],
       [0,0,0,0,0,0,0,0,0]]

# take the base, and split it
# into base(3) bits
for cy in range(3):
   for cx in range(3):

      lbit=bgrid[cy][cx]/3
      rbit=bgrid[cy][cx]%3

      sgrid[cy][cx]=[lbit,rbit]

# the left bit, the right bit,
# and some modulo magic
for by in range(3):
   for bx in range(3):
      for cy in range(3):
         for cx in range(3):

            lbit=(sgrid[cy][cx][0]+bx)%3
            rbit=(sgrid[cy][cx][1]+by)%3

            fbit=lbit*3+rbit

            state[by*3+cy][bx*3+cx]=fbit

# kick it out to screen
bseq=['0','1','2','3','4','5','6','7','8','9']
aline=' +-------+-------+-------+\n'
cout=''
for k in range(9):
   if (k%3)==0: cout+=aline
   for j in range(3):
      cout+=' |'
      for i in range(3):
         cout+=' '+bseq[state[k][j*3+i]]
   cout+=' |\n'
cout+=aline
print(cout)



(Edited by warjournal on 11-06-2016 14:33)

warjournal
Maniac (V) Mad Scientist

From:
Insane since: Aug 2000

posted posted 12-31-2016 11:32

And now for something different.
A proof-of-concept.

The following is the very first output from using
extra-polation to generate a puzzle.

I took several small puzzles, put them together,
expanded using nearest neighbor, shuffled some
data, and then solved.

Makes me giggle.
:kekeke:



code:
4058 A6E9 C1B3 7FD2 
192C 387F 06AD E54B 
6D7E 40BC 52F9 81A3 
AB3F 512D 84E7 069C 

5287 FBA1 9ED4 C036 
FA04 2C87 6B31 9DE5 
E6C3 94D5 A702 B81F 
91BD 630E FC85 247A 

3FA0 8742 E59B 1C6D 
8716 EDCB 4A2F 3950 
BE49 1A56 3DC0 F728 
C5D2 0F93 1876 4ABE 

D3E1 B5F0 796C A284 
246B C938 DF1A 5E07 
78FA D214 B05E 63C9 
0C95 7E6A 2348 DBF1

warjournal
Maniac (V) Mad Scientist

From:
Insane since: Aug 2000

posted posted 01-08-2017 08:33

A few days ago I was playing around with the idea of creating a regular latin square using strictly bitwise ops.
Six bit ops all together. That's it.

This is what my bit muncher it spit out:

code:
0 1 2 3 4 5 6 7
1 0 3 2 5 4 7 6
2 3 0 1 6 7 4 5
3 2 1 0 7 6 5 4
4 5 6 7 0 1 2 3
5 4 7 6 1 0 3 2
6 7 4 5 2 3 0 1
7 6 5 4 3 2 1 0



I was happy that I nailed it. Then I got to looking at the base pattern a lot closer.
It's fractal. Perfectly fractal. And there are an awful lot of other interesting things in there.

Then I starting playing around with it. You know, shuffling it up and seeing if I can
manipulate it with intent. As it turns out, it is rather easy to generate an orthogonal
pair. One of the cool things about the orthos is that they become look-up tables
for more orthos. Come on, now that's seriously cool.

Using that pattern, I can create a sudoku field that is as perfect or imperfect as I want.

Just for giggles, here is one of the orthos to the above base pattern:

code:
6 4 2 0 5 7 1 3 
7 5 3 1 4 6 0 2 
4 6 0 2 7 5 3 1 
5 7 1 3 6 4 2 0 
2 0 6 4 1 3 5 7 
3 1 7 5 0 2 4 6 
0 2 4 6 3 1 7 5 
1 3 5 7 2 0 6 4



And that ortho contains the sequences for even more orthos for the same
base pattern.

Damn, I love this shit.

warjournal
Maniac (V) Mad Scientist

From:
Insane since: Aug 2000

posted posted 01-13-2017 15:27

I was doing some thinking about it, looking for the reasons why things work so
I could boil it down to the bare essentials.
Turns out I was taking a few extra steps.

To create the starting fractal grid, just use XOR.

grid[x][y]=x^y

If you use a power of 2, instant awesomeness. The pattern follows the XOR truth
table, of course.

To get an orthogonal of it, approach it as a cover-all problem. A very simple
variation of Algorithm X does the trick just fine. Or maybe think of it as a
distribution problem.

Still a lot of work to do in this direction. It's been difficult finding the time.
But I'll get there.

warjournal
Maniac (V) Mad Scientist

From:
Insane since: Aug 2000

posted posted 01-15-2017 07:42

So far everything is working dandy.
All of my cursory glances are looking good.
That is, so far no signs of glaring patterns
left in the final grid.
Some more tweaking to do and it should be all
good.

code:
+pk7vWDQ GBJAd9tx I16U/FCY SwlbiMfP 2rLRyzom ceEHOsX5 Tq0uZjVh n43Ka8Ng 
efAF6h3Y InQ2yXbR cmi0vBoM daGq4T+1 ZgEjtVP9 7zlJD8KU prx5N/HS wkuLWCOs 
KlPy48JN CwmWjD5q eHsuVhSn 6ZAXYFo2 BOdik3fb Q1RLIxTr gacG9ztU /0M+Epv7 
nTMSRHIx 7VzLuso1 GtqEb59w WUm8DBkh 0+/lKcNp CgYa2vyZ FAeO346f QrPJXjid 
ij5BwamU c/Z+f4Eg T28LlKpr tuHQOv3C sXSY1xFe Nb0V6ohd JyWPMnk7 9GRAqIDz 
0CZdr/ob YHOle8kU R7jgPxfD NpnV9zKJ vaQW5MA4 q3u+BtiG Xs1I2wEL mFThcS6y 
tqc9GEgz P0ivTSKa 3XQkJ4NO RLyrsxe7 nuC6wIhH WFjfpAM/ d8+Dobml 1BVU25ZY 
L1OuVXs2 3N6hMpFr zydaA+ZW c0E/5gIj J7UDGT8q P94knmwS RKCiYBQv Hxfbtleo



That is the first line of blocks and I'm not seeing anything obvious or even mildly hidden.

Looks like things will finally be Certified WJ Approved.

warjournal
Maniac (V) Mad Scientist

From:
Insane since: Aug 2000

posted posted 01-26-2017 00:37

I figured it all out. The patterns are rather easy. However, I did find a repository of
squares and I'll be playing with those for awhile as well.

Combitorial Data
Main classes of Graeco-Latin squares
order 8 (2165)
(oa82mc.txt)

Using that data set, I whipped these out:

4a.html
4b.html

Ya'll are free to grab those and play with them. Edit the sources (HTML/CSS) and do whatever.
Make something pretty, damn it.

The one with the hiddens is the most basic algorithm ever.

I did find a repos of bigger latin squares and their orthos. These things are monsters. And I
think I have a graphical way of putting these on a screen.

Pretty soon it will be time to do some serious writing.

Back to the grind for awhile.

warjournal
Maniac (V) Mad Scientist

From:
Insane since: Aug 2000

posted posted 01-28-2017 19:46

I should be writing, but I'm having too much fun.

Proof of concept


faces1a.png


Perfectly playable... I think. It should be, but I haven't done the math on it.
But it is not divided into proper squares.
The size is 32x32 if you feel the need to grid it.
Base(8)=64x64
2048px by 2048px
Partially hidden, you'll see what I mean.

My first concept based on I-Ching, but not as much fun as emoticon/emoji faces.

Come on. Now that is cool.
VV00+!


edit:

Much better.

faces1b.gif

(Edited by warjournal on 01-29-2017 07:36)

warjournal
Maniac (V) Mad Scientist

From:
Insane since: Aug 2000

posted posted 04-08-2017 10:36

My work on XOR is currently in limbo. I don't have quite enough time to give it
the kind of focus and concentration that it needs. Know that I have found some
very interesting patterns that can do some very interesting things.

So, I got to playing a little bit with the data set found here:
Sudo3 Latins

That data can be used be used to generate a sudoku grid if you set it up like
Algorithm X. You know, approach it like a cover-all problem. The way I did it is
akin to a charging rhino - it just goes until it can't go anymore. Sometimes it
makes it to the end, and sometimes it runs out of possibilities. Not smart at
all, but it does work all the way through about 1/3 of the time.

Then I started exploring using that data for solving sudoku. More rhino.

Here is a starting grid. It is a minimum 17 sudoku puzzle.

code:
7 8 2  . . .  . . . 
. . .  3 . .  1 . . 
. . .  . . .  . . . 

. . .  5 . .  . 2 . 
. 9 .  . 8 .  . . . 
1 . .  . . .  3 . .

6 . 3  1 . .  . . .
. . .  . 4 .  . 8 9
. . .  . . .  . . .



Start with that, plug it into the data set, and see what possibilities pop out.

So, my rhino has a full data set, and decides to have a go at 1. Anything that is
not a 1, gets pruned out. Out of what's left, only the ones that match 1 are kept.
After all that, there are 10 possibilites left. My rhino doesn't know which way to go.
Not the smartest rhino.

Then 2, which ends up with too many possibilites. And so on for 3, 4, 5, 6, and 7.

Then my rhino had a go at 8. And things got interesting. After pruning and matching,
only one possibility was left. My rhino just solved for all of the 8's in the grid.

code:
7 8 2  . . .  . . .
. . .  3 . .  1 . 8
. . .  8 . .  . . .

. . .  5 . .  8 2 .
. 9 .  . 8 .  . . .
1 . 8  . . .  3 . .

6 . 3  1 . 8  . . .
. . .  . 4 .  . 8 9
8 . .  . . .  . . .



How awesome is that?

Now, if rhino were to have a go at 9, he would be left with one possibility and all 9's
would be solved in the grid as well. (For this particular puzzle, solving for all 8's and
9's is as far as my rhino can get. But I did check and naked singles and hidden singles
can solve the rest.)

I did check a handful of other grids and the above technique was able to completely solve
without any other techniques.

Solving sudoku puzzles in 1/9 chunks at a time.
Heh.

warjournal
Maniac (V) Mad Scientist

From:
Insane since: Aug 2000

posted posted 04-13-2017 23:34

I've been giving that data set a bit of a work-out as a solver. Mostly manual sifting and modifying.
In everything that I've thrown into it, no fancy tricks, no branches, and no dead-ends.
So far. I won't really know until I code the whole thing and can really pump a bunch of puzzles into it.


code:
.78...3......41...............8..57..2.......4........1.3.....45...2..6....7.....'
.78...34.....41...............8.457..2.......4........1.3.....45..42..6....7.....'
.78...34.....41..7............8.457.72.......4........1.3...7.45..42..6....7.....'
.78...34.....41..7............8.457.72.......48.......1.3...7.45..42..6.8..7.....'
.78...341....41..7............8.457.72.......48.......1.3...7.45..42.16.8..71....'
.78...341....41..7............8.457272.......48.......1.3...7245..42.16.8.271....'
.78...341....41..7..4.........8.457272....4..48.......1.3...7245..42.16.84271....' # 4 is solved
.78...341....41..7..4.........8.457272....4..48.......163...7245..42.16.842716...'
.78...341....41..7..4.........8.457272....4..48.......163...7245.742.16.842716...'
.78...341....418.7..4.........8.457272....48.48.......163...7245.742.168842716...'
.78...341....418.7.14........18.457272.1..48.48.....1.163...7245.742.168842716...' # 1 is solved
.78...341....418.7.14...2....18.457272.1..48.48.....1.163...7245.742.168842716...'
.78...341....418.7.14...2....18.457272.1..48.48.....1.163...7245.7423168842716.3.'
.78...341.5..418.7.14...25...18.457272.1..48.48.....1.163...7245.7423168842716.35'
.78...341.5..418.7.14...256..18.457272.1..48.48....61.163...7245.7423168842716.35'
.78...341.5..41897.14...256..189457272.1..48.48....61.163...724597423168842716935'
.78...341.5..41897.14...256.3189457272.1..48.48....61.163...724597423168842716935'
.786..341.56.41897.14...25663189457272.16.48.48....61.163...724597423168842716935' # 6 is solved
.786..341.56.41897.14...25663189457272.16.48348....61.163...724597423168842716935'
.786..341.56.41897.14...25663189457272916.48348....619163...724597423168842716935'
.7865.341.56.41897.14...256631894572729165483485...6191635..724597423168842716935' # 5 is solved
97865.341.56.41897.149..256631894572729165483485...6191635.9724597423168842716935' # 9 is solved
978652341256.41897.149..2566318945727291654834852..6191635.9724597423168842716935' # 2 is solved
9786523412563418973149..25663189457272916548348523.6191635.9724597423168842716935' # 3 is solved
97865234125634189731497.2566318945727291654834852376191635.9724597423168842716935' # 7 is solved
978652341256341897314978256631894572729165483485237619163589724597423168842716935' # 8 is solved



I can't help but wonder how well this would work if I made it play the probability game.
Instead of pruning until 100% is reached, what if I made it guess based on highest probability percentage?
Like, once a threshhold gap in percentage is reached or something. Now that would be interesting pruning.

As cool as this is, it won't really help me with bigger puzzles.
Exponential growth can be a reach bitch to sift through.



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu