Перейти к содержимому

Практикум по тест-дизайну 2.0
онлайн, начало 29 ноября
Тестирование мобильных приложений
онлайн, начало 27 ноября
Автоматизатор мобильных приложений
онлайн, начало 27 ноября
Программирование на Python для тестировщиков
онлайн, начало 22 ноября
Фотография

MegaSUDOKU killer


  • Авторизуйтесь для ответа в теме
Сообщений в теме: 32

#1 LKhiger

LKhiger

    Активный участник

  • Members
  • PipPip
  • 76 сообщений
  • ФИО:Леонид Хигер
  • Город:NY

Отправлено 26 Сентябрь 2009 - 01:52

There is level 3 sudoku, having 2 empty lines:

Sudoku Line

XXXXXXXXX
X7XXX6X3X
X3X72XX4X
7XXXX8XX1
6XX3X7XX5
5X91XXXXX
X8XX91X2X
X916XXX7X
XXXXXXXXX

Line 1: | 9 | 6 | 2 | 8 | 3 | 4 | 1 | 5 | 7 |
Line 2: | 8 | 7 | 4 | 5 | 1 | 6 | 9 | 3 | 2 |
Line 3: | 1 | 3 | 5 | 7 | 2 | 9 | 6 | 4 | 8 |
Line 4: | 7 | 2 | 3 | 9 | 5 | 8 | 4 | 6 | 1 |
Line 5: | 6 | 1 | 8 | 3 | 4 | 7 | 2 | 9 | 5 |
Line 6: | 5 | 4 | 9 | 1 | 6 | 2 | 7 | 8 | 3 |
Line 7: | 3 | 8 | 7 | 4 | 9 | 1 | 5 | 2 | 6 |
Line 8: | 2 | 9 | 1 | 6 | 8 | 5 | 3 | 7 | 4 |
Line 9: | 4 | 5 | 6 | 2 | 7 | 3 | 8 | 1 | 9 |

Our solver spent 11 second to find this single solution.

Now we make simple experiment: we'll change line 4 by remove 1 from source string:

7XXXX8XX1 ==> 7XXXX8XX0

We expect the same single solution, but not.

Because we have 2 empty lines we'll have multiple solutions.:eek:

Ok, every solution will shown to you, but how ? :blush:

Line 1: ........
Line 1: ........
..................
Line 1: ........
Line 2: ........
Line 2: ........
..................
Line 2: ........ etc. :diablo: :diablo: :diablo:

How combine these lines in complete sudoku solutions ? :dirol:

For this I created the new termin (column) named Weight. :clapping: :friends: :victory:

The weight has to be unique for every single solution. :good:

Weight = 'Line 1:... ' || 'Line 2:... ' ||.... || 'Line 9:... '.

Then I used Group By and Order BY for Weight & Line##. :acute:

As Result:

Sudoku Line
XXXXXXXXX
X7XXX6X3X
X3X72XX4X
7XXXX8XXX
6XX3X7XX5
5X91XXXXX
X8XX91X2X
X916XXX7X
XXXXXXXXX
Line 1: | 1 | 6 | 2 | 8 | 3 | 4 | 7 | 5 | 9 |
Line 2: | 9 | 7 | 4 | 5 | 1 | 6 | 8 | 3 | 2 |
Line 3: | 8 | 3 | 5 | 7 | 2 | 9 | 6 | 4 | 1 |
Line 4: | 7 | 1 | 3 | 9 | 5 | 8 | 2 | 6 | 4 |
Line 5: | 6 | 2 | 8 | 3 | 4 | 7 | 1 | 9 | 5 |
Line 6: | 5 | 4 | 9 | 1 | 6 | 2 | 3 | 8 | 7 |
Line 7: | 3 | 8 | 7 | 4 | 9 | 1 | 5 | 2 | 6 |
Line 8: | 2 | 9 | 1 | 6 | 8 | 5 | 4 | 7 | 3 |
Line 9: | 4 | 5 | 6 | 2 | 7 | 3 | 9 | 1 | 8 |

Line 1: | 1 | 6 | 2 | 8 | 3 | 4 | 7 | 5 | 9 |
Line 2: | 9 | 7 | 4 | 5 | 1 | 6 | 8 | 3 | 2 |
Line 3: | 8 | 3 | 5 | 7 | 2 | 9 | 6 | 4 | 1 |
Line 4: | 7 | 1 | 3 | 9 | 5 | 8 | 2 | 6 | 4 |
Line 5: | 6 | 2 | 8 | 3 | 4 | 7 | 9 | 1 | 5 |
Line 6: | 5 | 4 | 9 | 1 | 6 | 2 | 3 | 8 | 7 |
Line 7: | 3 | 8 | 7 | 4 | 9 | 1 | 5 | 2 | 6 |
Line 8: | 2 | 9 | 1 | 6 | 8 | 5 | 4 | 7 | 3 |
Line 9: | 4 | 5 | 6 | 2 | 7 | 3 | 1 | 9 | 8 |

Line 1: | 1 | 6 | 2 | 8 | 3 | 4 | 7 | 5 | 9 |
Line 2: | 9 | 7 | 4 | 5 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| 6 | 1 | 8 | 3 | 4 | 7 | 2 | 9 | 5 |
Line 6: | 5 | 4 | 9 | 1 | 6 | 2 | 3 | 8 | 7 |
Line 7: | 3 | 8 | 7 | 4 | 9 | 1 | 5 | 2 | 6 |
Line 8: | 2 | 9 | 1 | 6 | 8 | 5 | 4 | 7 | 3 |
Line 9: | 4 | 5 | 6 | 2 | 7 | 3 | 8 | 1 | 9 |

we got 8 different solutions in 1 minute. :focus: :focus: :focus:

Lenny

P.S. Code in an attachment :blush: :blush: :blush:

Прикрепленные файлы


  • 0

#2 LKhiger

LKhiger

    Активный участник

  • Members
  • PipPip
  • 76 сообщений
  • ФИО:Леонид Хигер
  • Город:NY

Отправлено 27 Сентябрь 2009 - 03:31

"MegaSUDOKU killer" - Это вам не примитивные джойны, которым можно и бабушек обучить. :dirol:

Даже если джойны левые.

Это стройный алгоритм на котором студентов учить можно.

А также удивлять ново-русских юзерманов.... :friends: :diablo: :blush:

Дерзайте, качайте, бабло получате ! (шютка)....

Lenny
  • 0

#3 LKhiger

LKhiger

    Активный участник

  • Members
  • PipPip
  • 76 сообщений
  • ФИО:Леонид Хигер
  • Город:NY

Отправлено 02 Октябрь 2009 - 02:54

Кто нибудь попробовал ? У меня на работе нет отбоя от желающих попробовать. Даже забыли про кризис.

Но это США. Здесь очень популярна Судоку. :dirol:
А как у вас в России ? :good:

Если возникают трудности. Дайте знать. Помогу материально. :blush:

Лёня Хигер.
  • 0

#4 Clauster

Clauster

    Гуру

  • Members
  • PipPipPipPipPipPip
  • 1 913 сообщений
  • ФИО:Худобородов Валерий
  • Город:Espoo

Отправлено 02 Октябрь 2009 - 14:15

горшочек не вари.
  • 0

#5 LKhiger

LKhiger

    Активный участник

  • Members
  • PipPip
  • 76 сообщений
  • ФИО:Леонид Хигер
  • Город:NY

Отправлено 03 Октябрь 2009 - 01:53

горшочек не вари.

С вами кашу не сваришь, уважаемый !

Да я и не пытаюсь. Откуда столько постов ? Где здесь народ гуляить ?

Лёня Х. :blush:

ADSPA, VP.
  • 0

#6 LKhiger

LKhiger

    Активный участник

  • Members
  • PipPip
  • 76 сообщений
  • ФИО:Леонид Хигер
  • Город:NY

Отправлено 08 Октябрь 2009 - 01:45

А этот Судоку построил и решил мой новый объект "Судоку-создатель" (Sudoku-creator):

Sudoku Line

31X7X6XXX
5XXXX3X26
XXXXXXXXX
XX5XXXX4X
XX45XXX39
63XXX7XX5
XX1XX29X4
49XX6XXXX
X8XXXXX5X

Line 1: | 3 | 1 | 2 | 7 | 5 | 6 | 4 | 9 | 8 |
Line 2: | 5 | 4 | 7 | 8 | 9 | 3 | 1 | 2 | 6 |
Line 3: | 8 | 6 | 9 | 2 | 1 | 4 | 5 | 7 | 3 |
Line 4: | 9 | 2 | 5 | 6 | 3 | 1 | 8 | 4 | 7 |
Line 5: | 1 | 7 | 4 | 5 | 2 | 8 | 6 | 3 | 9 |
Line 6: | 6 | 3 | 8 | 9 | 4 | 7 | 2 | 1 | 5 |
Line 7: | 7 | 5 | 1 | 3 | 8 | 2 | 9 | 6 | 4 |
Line 8: | 4 | 9 | 3 | 1 | 6 | 5 | 7 | 8 | 2 |
Line 9: | 2 | 8 | 6 | 4 | 7 | 9 | 3 | 5 | 1 |


Вы можете попытаться решить его самостоятельно и сравнить своё решение с приложенным ответом. :victory: :acute: :victory:

"Судоку-создатель" находится в режиме кодирования поэтому я вам его пока не показываю.

Lenny Khiger, ADSPA@VP
  • 0

#7 LKhiger

LKhiger

    Активный участник

  • Members
  • PipPip
  • 76 сообщений
  • ФИО:Леонид Хигер
  • Город:NY

Отправлено 15 Октябрь 2009 - 01:42

Elegant Sudoku.

With 2 empty regions. Starting with empty region.
Startnumbers: 27. <-- 2 sec -->:


Sudoku Line

XXX7XXX85
XXXX45XX7
XXXX8123X
X8XXXXX9X
XX3X2X4XX
X9XXXXX6X
X7651XXXX
5XX47XXXX
12XXX3XXX

Line 1: | 2 | 4 | 1 | 7 | 3 | 9 | 6 | 8 | 5 |
Line 2: | 3 | 6 | 8 | 2 | 4 | 5 | 9 | 1 | 7 |
Line 3: | 9 | 5 | 7 | 6 | 8 | 1 | 2 | 3 | 4 |
Line 4: | 7 | 8 | 5 | 3 | 6 | 4 | 1 | 9 | 2 |
Line 5: | 6 | 1 | 3 | 9 | 2 | 7 | 4 | 5 | 8 |
Line 6: | 4 | 9 | 2 | 1 | 5 | 8 | 7 | 6 | 3 |
Line 7: | 8 | 7 | 6 | 5 | 1 | 2 | 3 | 4 | 9 |
Line 8: | 5 | 3 | 9 | 4 | 7 | 6 | 8 | 2 | 1 |
Line 9: | 1 | 2 | 4 | 8 | 9 | 3 | 5 | 7 | 6 |




Lenny
  • 0

#8 LKhiger

LKhiger

    Активный участник

  • Members
  • PipPip
  • 76 сообщений
  • ФИО:Леонид Хигер
  • Город:NY

Отправлено 17 Октябрь 2009 - 00:30

Минимальная заполненная Судоку.

Самая первая в списке всех заполненных Судоку.

Line 1: | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
Line 2: | 4 | 5 | 6 | 7 | 8 | 9 | 1 | 2 | 3 |
Line 3: | 7 | 8 | 9 | 1 | 2 | 3 | 4 | 5 | 6 |
Line 4: | 2 | 1 | 4 | 3 | 6 | 5 | 8 | 9 | 7 |
Line 5: | 3 | 6 | 5 | 8 | 9 | 7 | 2 | 1 | 4 |
Line 6: | 8 | 9 | 7 | 2 | 1 | 4 | 3 | 6 | 5 |
Line 7: | 5 | 3 | 1 | 6 | 4 | 2 | 9 | 7 | 8 |
Line 8: | 6 | 4 | 2 | 9 | 7 | 8 | 5 | 3 | 1 |
Line 9: | 9 | 7 | 8 | 5 | 3 | 1 | 6 | 4 | 2 |


Lenny
  • 0

#9 LKhiger

LKhiger

    Активный участник

  • Members
  • PipPip
  • 76 сообщений
  • ФИО:Леонид Хигер
  • Город:NY

Отправлено 21 Октябрь 2009 - 01:49

Today "Metro" NY page 23:

Easy - 0 sec

Sudoku Line

XXX8X4X36
XXXXX1X9X
XXXXXX542
XX7X19XX3
X84XXX21X
6XX32X7XX
239XXXXXX
X4X5XXXXX
71X6X3XXX

Line 1: | 9 | 5 | 2 | 8 | 7 | 4 | 1 | 3 | 6 |
Line 2: | 4 | 6 | 3 | 2 | 5 | 1 | 8 | 9 | 7 |
Line 3: | 1 | 7 | 8 | 9 | 3 | 6 | 5 | 4 | 2 |
Line 4: | 5 | 2 | 7 | 4 | 1 | 9 | 6 | 8 | 3 |
Line 5: | 3 | 8 | 4 | 7 | 6 | 5 | 2 | 1 | 9 |
Line 6: | 6 | 9 | 1 | 3 | 2 | 8 | 7 | 5 | 4 |
Line 7: | 2 | 3 | 9 | 1 | 8 | 7 | 4 | 6 | 5 |
Line 8: | 8 | 4 | 6 | 5 | 9 | 2 | 3 | 7 | 1 |
Line 9: | 7 | 1 | 5 | 6 | 4 | 3 | 9 | 2 | 8 |


Hard - 5 sec

Sudoku Line

1X47XXXXX
XX8X64X5X
5XX81XXXX
XX9X27XX4
8XXXXXXX5
7XX68X9XX
XXXX76XX2
X6X49X1XX
XXXXX84X6

Line 1: | 1 | 2 | 4 | 7 | 5 | 3 | 6 | 8 | 9 |
Line 2: | 3 | 7 | 8 | 9 | 6 | 4 | 2 | 5 | 1 |
Line 3: | 5 | 9 | 6 | 8 | 1 | 2 | 3 | 4 | 7 |
Line 4: | 6 | 3 | 9 | 5 | 2 | 7 | 8 | 1 | 4 |
Line 5: | 8 | 1 | 2 | 3 | 4 | 9 | 7 | 6 | 5 |
Line 6: | 7 | 4 | 5 | 6 | 8 | 1 | 9 | 2 | 3 |
Line 7: | 4 | 8 | 3 | 1 | 7 | 6 | 5 | 9 | 2 |
Line 8: | 2 | 6 | 7 | 4 | 9 | 5 | 1 | 3 | 8 |
Line 9: | 9 | 5 | 1 | 2 | 3 | 8 | 4 | 7 | 6 |


Lenny
  • 0

#10 LKhiger

LKhiger

    Активный участник

  • Members
  • PipPip
  • 76 сообщений
  • ФИО:Леонид Хигер
  • Город:NY

Отправлено 22 Октябрь 2009 - 01:07

Today "AM", NY, page 37, level-3 (5 sec):

Sudoku Line

XXX7X2X1X
XX6XXX58X
3XX1XXXX2
7XX6X5XXX
XX3XXX4XX
XXX2X9XX3
9X2XX8XX1
X58XXXXXX
XXX4XXXXX

Line 1: | 4 | 8 | 9 | 7 | 5 | 2 | 3 | 1 | 6 |
Line 2: | 2 | 1 | 6 | 3 | 9 | 4 | 5 | 8 | 7 |
Line 3: | 3 | 7 | 5 | 1 | 8 | 6 | 9 | 4 | 2 |
Line 4: | 7 | 9 | 4 | 6 | 3 | 5 | 1 | 2 | 8 |
Line 5: | 5 | 2 | 3 | 8 | 1 | 7 | 4 | 6 | 9 |
Line 6: | 8 | 6 | 1 | 2 | 4 | 9 | 7 | 5 | 3 |
Line 7: | 9 | 4 | 2 | 5 | 7 | 8 | 6 | 3 | 1 |
Line 8: | 1 | 5 | 8 | 9 | 6 | 3 | 2 | 7 | 4 |
Line 9: | 6 | 3 | 7 | 4 | 2 | 1 | 8 | 9 | 5 |


Lenny
  • 0

#11 LKhiger

LKhiger

    Активный участник

  • Members
  • PipPip
  • 76 сообщений
  • ФИО:Леонид Хигер
  • Город:NY

Отправлено 24 Октябрь 2009 - 19:21

Friday 10/23/09 "AM" NY page 32, level-4 <-- 10 sec -->

Source (line, sudoku_str) as 
(
select 1, '000100000'
  from sysibm.sysdummy1
union all
select 2, '000609500'
  from sysibm.sysdummy1
union all
select 3, '302000004'
  from sysibm.sysdummy1
union all 
select 4, '001080700'
  from sysibm.sysdummy1
union all
select 5, '600000002'
  from sysibm.sysdummy1
union all
select 6, '008030900'
  from sysibm.sysdummy1
union all
select 7, '500000601'
  from sysibm.sysdummy1
union all
select 8, '006300200'
  from sysibm.sysdummy1
union all
select 9, '800007400'
  from sysibm.sysdummy1
)

Result:

Sudoku Line

XXX1XXXXX
XXX6X95XX
3X2XXXXX4
XX1X8X7XX
6XXXXXXX2
XX8X3X9XX
5XXXXX6X1
XX63XX2XX
8XXXX74XX

Line 1: | 7 | 6 | 5 | 1 | 4 | 3 | 8 | 2 | 9 |
Line 2: | 1 | 8 | 4 | 6 | 2 | 9 | 5 | 3 | 7 |
Line 3: | 3 | 9 | 2 | 8 | 7 | 5 | 1 | 6 | 4 |
Line 4: | 9 | 3 | 1 | 5 | 8 | 2 | 7 | 4 | 6 |
Line 5: | 6 | 5 | 7 | 9 | 1 | 4 | 3 | 8 | 2 |
Line 6: | 2 | 4 | 8 | 7 | 3 | 6 | 9 | 1 | 5 |
Line 7: | 5 | 2 | 3 | 4 | 9 | 8 | 6 | 7 | 1 |
Line 8: | 4 | 7 | 6 | 3 | 5 | 1 | 2 | 9 | 8 |
Line 9: | 8 | 1 | 9 | 2 | 6 | 7 | 4 | 5 | 3 |


Friday 10/23/09 "Metro" NY page 20 HARD <-- 1 sec -->

Source (line, sudoku_str) as 
(
select 1, '000780010'
  from sysibm.sysdummy1
union all
select 2, '000305860'
  from sysibm.sysdummy1
union all
select 3, '080021300'
  from sysibm.sysdummy1
union all 
select 4, '017000500'
  from sysibm.sysdummy1
union all
select 5, '800000006'
  from sysibm.sysdummy1
union all
select 6, '004000120'
  from sysibm.sysdummy1
union all
select 7, '001260080'
  from sysibm.sysdummy1
union all
select 8, '043809000'
  from sysibm.sysdummy1
union all
select 9, '020034000'
  from sysibm.sysdummy1
)

Result:

Sudoku Line

XXX78XX1X
XXX3X586X
X8XX213XX
X17XXX5XX
8XXXXXXX6
XX4XXX12X
XX126XX8X
X438X9XXX
X2XX34XXX

Line 1: | 5 | 3 | 2 | 7 | 8 | 6 | 9 | 1 | 4 |
Line 2: | 1 | 7 | 9 | 3 | 4 | 5 | 8 | 6 | 2 |
Line 3: | 4 | 8 | 6 | 9 | 2 | 1 | 3 | 5 | 7 |
Line 4: | 2 | 1 | 7 | 6 | 9 | 3 | 5 | 4 | 8 |
Line 5: | 8 | 9 | 5 | 4 | 1 | 2 | 7 | 3 | 6 |
Line 6: | 3 | 6 | 4 | 5 | 7 | 8 | 1 | 2 | 9 |
Line 7: | 9 | 5 | 1 | 2 | 6 | 7 | 4 | 8 | 3 |
Line 8: | 6 | 4 | 3 | 8 | 5 | 9 | 2 | 7 | 1 |
Line 9: | 7 | 2 | 8 | 1 | 3 | 4 | 6 | 9 | 5 |



Lenny :victory:
  • 0

#12 LKhiger

LKhiger

    Активный участник

  • Members
  • PipPip
  • 76 сообщений
  • ФИО:Леонид Хигер
  • Город:NY

Отправлено 24 Октябрь 2009 - 20:37

Хотите посоревноваться с моей машиной ?

Видите в предыдущем сообщении level-4 Судоку ?

Её машина решила за 10 секунд.
Я вам даю 30 минут, что в 180 раз больше.

Справитесь ? :victory:

Lenny
  • 0

#13 LKhiger

LKhiger

    Активный участник

  • Members
  • PipPip
  • 76 сообщений
  • ФИО:Леонид Хигер
  • Город:NY

Отправлено 31 Октябрь 2009 - 02:18

Halloween's Sudokus

10/30/09 "Metro", NY page 26 HARD --> 4 sec <--

Source (line, sudoku_str) as 
(
select 1, '000030500'
from sysibm.sysdummy1
union all
select 2, '000102460'
from sysibm.sysdummy1
union all
select 3, '000006102'
from sysibm.sysdummy1
union all 
select 4, '000091708'
from sysibm.sysdummy1
union all
select 5, '041000930'
from sysibm.sysdummy1
union all
select 6, '907460000'
from sysibm.sysdummy1
union all
select 7, '405300000'
from sysibm.sysdummy1
union all
select 8, '072605000'
from sysibm.sysdummy1
union all
select 9, '009080000'
from sysibm.sysdummy1
)

Sudoku Line

XXXX3X5XX
XXX1X246X
XXXXX61X2
XXXX917X8
X41XXX93X
9X746XXXX
4X53XXXXX
X726X5XXX
XX9X8XXXX

Line 1: | 2 | 1 | 6 | 8 | 3 | 4 | 5 | 7 | 9 |
Line 2: | 7 | 9 | 8 | 1 | 5 | 2 | 4 | 6 | 3 |
Line 3: | 3 | 5 | 4 | 9 | 7 | 6 | 1 | 8 | 2 |
Line 4: | 6 | 2 | 3 | 5 | 9 | 1 | 7 | 4 | 8 |
Line 5: | 5 | 4 | 1 | 7 | 2 | 8 | 9 | 3 | 6 |
Line 6: | 9 | 8 | 7 | 4 | 6 | 3 | 2 | 1 | 5 |
Line 7: | 4 | 6 | 5 | 3 | 1 | 9 | 8 | 2 | 7 |
Line 8: | 8 | 7 | 2 | 6 | 4 | 5 | 3 | 9 | 1 |
Line 9: | 1 | 3 | 9 | 2 | 8 | 7 | 6 | 5 | 4 |



10/30/09 "AM", NY page 24 LEVEL-4 --> 25 sec <--

Source (line, sudoku_str) as 
(
select 1, '040901000'
from sysibm.sysdummy1
union all
select 2, '009000205'
from sysibm.sysdummy1
union all
select 3, '100020790'
from sysibm.sysdummy1
union all 
select 4, '900200000'
from sysibm.sysdummy1
union all
select 5, '500300008'
from sysibm.sysdummy1
union all
select 6, '000007009'
from sysibm.sysdummy1
union all
select 7, '098060001'
from sysibm.sysdummy1
union all
select 8, '604000500'
from sysibm.sysdummy1
union all
select 9, '000402080'
from sysibm.sysdummy1
)

Sudoku Line

X4X9X1XXX
XX9XXX2X5
1XXX2X79X
9XX2XXXXX
5XX3XXXX8
XXXXX7XX9
X98X6XXX1
6X4XXX5XX
XXX4X2X8X

Line 1: | 7 | 4 | 2 | 9 | 5 | 1 | 8 | 6 | 3 |
Line 2: | 8 | 6 | 9 | 7 | 3 | 4 | 2 | 1 | 5 |
Line 3: | 1 | 3 | 5 | 8 | 2 | 6 | 7 | 9 | 4 |
Line 4: | 9 | 8 | 6 | 2 | 1 | 5 | 3 | 4 | 7 |
Line 5: | 5 | 1 | 7 | 3 | 4 | 9 | 6 | 2 | 8 |
Line 6: | 4 | 2 | 3 | 6 | 8 | 7 | 1 | 5 | 9 |
Line 7: | 2 | 9 | 8 | 5 | 6 | 3 | 4 | 7 | 1 |
Line 8: | 6 | 7 | 4 | 1 | 9 | 8 | 5 | 3 | 2 |
Line 9: | 3 | 5 | 1 | 4 | 7 | 2 | 9 | 8 | 6 |


Lenny Khiger, ADSPA&VP

P.S. I have attached the fresh copy of Solver's code to this message
with today HARD Sudoku
:smile:

Прикрепленные файлы


  • 0

#14 LKhiger

LKhiger

    Активный участник

  • Members
  • PipPip
  • 76 сообщений
  • ФИО:Леонид Хигер
  • Город:NY

Отправлено 14 Ноябрь 2009 - 01:56

....Friday 13..... :victory:
11/13/09 "Metro" NY page 25 HARD --> 1 sec <--
:biggrin:

Source (line, sudoku_str) as
(
select 1, '031004000'
  from sysibm.sysdummy1
union all
select 2, '900016000'
  from sysibm.sysdummy1
union all
select 3, '006730000'
  from sysibm.sysdummy1
union all
select 4, '300090205'
  from sysibm.sysdummy1
union all
select 5, '084000730'
  from sysibm.sysdummy1
union all
select 6, '209070001'
  from sysibm.sysdummy1
union all
select 7, '000057900'
  from sysibm.sysdummy1
union all
select 8, '000360004'
  from sysibm.sysdummy1
union all
select 9, '000800310'
  from sysibm.sysdummy1
)

Result:

Sudoku Line

X31XX4XXX
9XXX16XXX
XX673XXXX
3XXX9X2X5
X84XXX73X
2X9X7XXX1
XXXX579XX
XXX36XXX4
XXX8XX31X

Line 1: | 7 | 3 | 1 | 9 | 8 | 4 | 6 | 5 | 2 |
Line 2: | 9 | 5 | 8 | 2 | 1 | 6 | 4 | 7 | 3 |
Line 3: | 4 | 2 | 6 | 7 | 3 | 5 | 1 | 9 | 8 |
Line 4: | 3 | 1 | 7 | 4 | 9 | 8 | 2 | 6 | 5 |
Line 5: | 5 | 8 | 4 | 6 | 2 | 1 | 7 | 3 | 9 |
Line 6: | 2 | 6 | 9 | 5 | 7 | 3 | 8 | 4 | 1 |
Line 7: | 8 | 4 | 3 | 1 | 5 | 7 | 9 | 2 | 6 |
Line 8: | 1 | 7 | 2 | 3 | 6 | 9 | 5 | 8 | 4 |
Line 9: | 6 | 9 | 5 | 8 | 4 | 2 | 3 | 1 | 7 |


Lenny
  • 0

#15 LKhiger

LKhiger

    Активный участник

  • Members
  • PipPip
  • 76 сообщений
  • ФИО:Леонид Хигер
  • Город:NY

Отправлено 14 Ноябрь 2009 - 02:47

Кому теперь нужны Судоки ?
Зачем нам голову ломать ?
Не вижу в них большого проку,
Их может СУБД решать !


Lenny
  • 0

#16 LKhiger

LKhiger

    Активный участник

  • Members
  • PipPip
  • 76 сообщений
  • ФИО:Леонид Хигер
  • Город:NY

Отправлено 14 Ноябрь 2009 - 18:59

Мне удалось сократить размер решателя Судоку почти на 5К не уменьшая его производительность.

Отдаю вам эту версию на тестирование. Кстати, вчерашнее Судоку была решена на нём. Скорость, как вы видите - прекрасная.


Лёня Хигер (бывший совок).

Прикрепленные файлы


  • 0

#17 LKhiger

LKhiger

    Активный участник

  • Members
  • PipPip
  • 76 сообщений
  • ФИО:Леонид Хигер
  • Город:NY

Отправлено 14 Ноябрь 2009 - 19:32

Минимальная заполненная Судоку.

Самая первая в списке всех заполненных Судоку.


Line 1: | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
Line 2: | 4 | 5 | 6 | 7 | 8 | 9 | 1 | 2 | 3 |
Line 3: | 7 | 8 | 9 | 1 | 2 | 3 | 4 | 5 | 6 |
Line 4: | 2 | 1 | 4 | 3 | 6 | 5 | 8 | 9 | 7 |
Line 5: | 3 | 6 | 5 | 8 | 9 | 7 | 2 | 1 | 4 |
Line 6: | 8 | 9 | 7 | 2 | 1 | 4 | 3 | 6 | 5 |
Line 7: | 5 | 3 | 1 | 6 | 4 | 2 | 9 | 7 | 8 |
Line 8: | 6 | 4 | 2 | 9 | 7 | 8 | 5 | 3 | 1 |
Line 9: | 9 | 7 | 8 | 5 | 3 | 1 | 6 | 4 | 2 |



Lenny
  • 0

#18 LKhiger

LKhiger

    Активный участник

  • Members
  • PipPip
  • 76 сообщений
  • ФИО:Леонид Хигер
  • Город:NY

Отправлено 18 Ноябрь 2009 - 03:12

11/17/09 "Metro" page 24 HARD --> 1 sec <--

Source (line, sudoku_str) as
(
select 1, '041705098'
  from sysibm.sysdummy1
union all
select 2, '050308000'
  from sysibm.sysdummy1
union all
select 3, '000040000'
  from sysibm.sysdummy1
union all
select 4, '205000031'
  from sysibm.sysdummy1
union all
select 5, '900000005'
  from sysibm.sysdummy1
union all
select 6, '170000802'
  from sysibm.sysdummy1
union all
select 7, '000030000'
  from sysibm.sysdummy1
union all
select 8, '000107020'
  from sysibm.sysdummy1
union all
select 9, '410602750'
  from sysibm.sysdummy1
)

Sudoku Line

X417X5X98
X5X3X8XXX
XXXX4XXXX
2X5XXXX31
9XXXXXXX5
17XXXX8X2
XXXX3XXXX
XXX1X7X2X
41X6X275X

Line 1: | 3 | 4 | 1 | 7 | 2 | 5 | 6 | 9 | 8 |
Line 2: | 6 | 5 | 9 | 3 | 1 | 8 | 2 | 4 | 7 |
Line 3: | 7 | 8 | 2 | 9 | 4 | 6 | 5 | 1 | 3 |
Line 4: | 2 | 6 | 5 | 8 | 7 | 4 | 9 | 3 | 1 |
Line 5: | 9 | 3 | 8 | 2 | 6 | 1 | 4 | 7 | 5 |
Line 6: | 1 | 7 | 4 | 5 | 9 | 3 | 8 | 6 | 2 |
Line 7: | 5 | 2 | 7 | 4 | 3 | 9 | 1 | 8 | 6 |
Line 8: | 8 | 9 | 6 | 1 | 5 | 7 | 3 | 2 | 4 |
Line 9: | 4 | 1 | 3 | 6 | 8 | 2 | 7 | 5 | 9 |


Lenny
  • 0

#19 LKhiger

LKhiger

    Активный участник

  • Members
  • PipPip
  • 76 сообщений
  • ФИО:Леонид Хигер
  • Город:NY

Отправлено 20 Ноябрь 2009 - 04:59

11/19/09: From 3 Newspapers (Very Hard, but very FAST)::blush:

Source (line, sudoku_str) as 
(
select 1, '082050000'
  from sysibm.sysdummy1
union all
select 2, '030047096'
  from sysibm.sysdummy1
union all
select 3, '000100002'
  from sysibm.sysdummy1
union all
select 4, '090000300'
  from sysibm.sysdummy1
union all
select 5, '520000041'
  from sysibm.sysdummy1
union all
select 6, '003000020'
  from sysibm.sysdummy1
union all
select 7, '300009000'
  from sysibm.sysdummy1
union all
select 8, '450630070'
  from sysibm.sysdummy1
union all
select 9, '000070910'
  from sysibm.sysdummy1
)

Line 1: | 7 | 8 | 2 | 9 | 5 | 6 | 1 | 3 | 4 |
Line 2: | 1 | 3 | 5 | 2 | 4 | 7 | 8 | 9 | 6 |
Line 3: | 9 | 4 | 6 | 1 | 8 | 3 | 7 | 5 | 2 |
Line 4: | 6 | 9 | 4 | 5 | 1 | 2 | 3 | 8 | 7 |
Line 5: | 5 | 2 | 7 | 3 | 9 | 8 | 6 | 4 | 1 |
Line 6: | 8 | 1 | 3 | 7 | 6 | 4 | 5 | 2 | 9 |
Line 7: | 3 | 7 | 1 | 8 | 2 | 9 | 4 | 6 | 5 |
Line 8: | 4 | 5 | 9 | 6 | 3 | 1 | 2 | 7 | 8 |
Line 9: | 2 | 6 | 8 | 4 | 7 | 5 | 9 | 1 | 3 |


Source (line, sudoku_str) as
(
select 1, '498000500'
  from sysibm.sysdummy1
union all
select 2, '700086001'
  from sysibm.sysdummy1
union all
select 3, '000000000'
  from sysibm.sysdummy1
union all
select 4, '009021800'
  from sysibm.sysdummy1
union all
select 5, '000000000'
  from sysibm.sysdummy1
union all
select 6, '005460700'
  from sysibm.sysdummy1
union all
select 7, '000000000'
  from sysibm.sysdummy1
union all
select 8, '600970304'
  from sysibm.sysdummy1
union all
select 9, '500000027'
  from sysibm.sysdummy1
)

Line 1: | 4 | 9 | 8 | 2 | 1 | 7 | 5 | 6 | 3 |
Line 2: | 7 | 2 | 3 | 5 | 8 | 6 | 4 | 9 | 1 |
Line 3: | 1 | 5 | 6 | 3 | 9 | 4 | 2 | 7 | 8 |
Line 4: | 3 | 4 | 9 | 7 | 2 | 1 | 8 | 5 | 6 |
Line 5: | 2 | 6 | 7 | 8 | 5 | 3 | 1 | 4 | 9 |
Line 6: | 8 | 1 | 5 | 4 | 6 | 9 | 7 | 3 | 2 |
Line 7: | 9 | 7 | 4 | 1 | 3 | 2 | 6 | 8 | 5 |
Line 8: | 6 | 8 | 2 | 9 | 7 | 5 | 3 | 1 | 4 |
Line 9: | 5 | 3 | 1 | 6 | 4 | 8 | 9 | 2 | 7 |


Source (line, sudoku_str) as
(
select 1, '200090000'
  from sysibm.sysdummy1
union all
select 2, '080203100'
  from sysibm.sysdummy1
union all
select 3, '301400205'
  from sysibm.sysdummy1
union all
select 4, '450000800'
  from sysibm.sysdummy1
union all
select 5, '900000004'
  from sysibm.sysdummy1
union all
select 6, '002000053'
  from sysibm.sysdummy1
union all
select 7, '108007602'
  from sysibm.sysdummy1
union all
select 8, '009802070'
  from sysibm.sysdummy1
union all
select 9, '000040008'
  from sysibm.sysdummy1
)

Line 1: | 2 | 6 | 5 | 1 | 9 | 8 | 3 | 4 | 7 |
Line 2: | 7 | 8 | 4 | 2 | 5 | 3 | 1 | 6 | 9 |
Line 3: | 3 | 9 | 1 | 4 | 7 | 6 | 2 | 8 | 5 |
Line 4: | 4 | 5 | 3 | 7 | 2 | 9 | 8 | 1 | 6 |
Line 5: | 9 | 1 | 6 | 3 | 8 | 5 | 7 | 2 | 4 |
Line 6: | 8 | 7 | 2 | 6 | 1 | 4 | 9 | 5 | 3 |
Line 7: | 1 | 4 | 8 | 5 | 3 | 7 | 6 | 9 | 2 |
Line 8: | 5 | 3 | 9 | 8 | 6 | 2 | 4 | 7 | 1 |
Line 9: | 6 | 2 | 7 | 9 | 4 | 1 | 5 | 3 | 8 |


Lenny
  • 0

#20 LKhiger

LKhiger

    Активный участник

  • Members
  • PipPip
  • 76 сообщений
  • ФИО:Леонид Хигер
  • Город:NY

Отправлено 27 Ноябрь 2009 - 16:49

New Version of XHard Sudoku Solver

ThanksGiving Sudokus && New Version of XHard Solver

Source (line, sudoku_str) as 
(
select 1, '100086000'
  from sysibm.sysdummy1
union all
select 2, '090201030'
  from sysibm.sysdummy1
union all
select 3, '680000000'
  from sysibm.sysdummy1
union all 
select 4, '008000900'
  from sysibm.sysdummy1
union all
select 5, '000875000'
  from sysibm.sysdummy1
union all
select 6, '004000100'
  from sysibm.sysdummy1
union all
select 7, '000300018'
  from sysibm.sysdummy1
union all
select 8, '070104020'
  from sysibm.sysdummy1
union all
select 9, '000020003'
  from sysibm.sysdummy1
)

Line 1: | 1 | 3 | 2 | 9 | 8 | 6 | 7 | 4 | 5 |
Line 2: | 4 | 9 | 7 | 2 | 5 | 1 | 8 | 3 | 6 |
Line 3: | 6 | 8 | 5 | 7 | 4 | 3 | 2 | 9 | 1 |
Line 4: | 3 | 6 | 8 | 4 | 1 | 2 | 9 | 5 | 7 |
Line 5: | 2 | 1 | 9 | 8 | 7 | 5 | 3 | 6 | 4 |
Line 6: | 7 | 5 | 4 | 6 | 3 | 9 | 1 | 8 | 2 |
Line 7: | 5 | 2 | 6 | 3 | 9 | 7 | 4 | 1 | 8 |
Line 8: | 8 | 7 | 3 | 1 | 6 | 4 | 5 | 2 | 9 |
Line 9: | 9 | 4 | 1 | 5 | 2 | 8 | 6 | 7 | 3 |


Source (line, sudoku_str) as 
(
select 1, '670200000'
  from sysibm.sysdummy1
union all
select 2, '204036070'
  from sysibm.sysdummy1
union all
select 3, '005400000'
  from sysibm.sysdummy1
union all 
select 4, '080000046'
  from sysibm.sysdummy1
union all
select 5, '007104800'
  from sysibm.sysdummy1
union all
select 6, '410000050'
  from sysibm.sysdummy1
union all
select 7, '000003400'
  from sysibm.sysdummy1
union all
select 8, '040910605'
  from sysibm.sysdummy1
union all
select 9, '000002039'
  from sysibm.sysdummy1
)

Line 1: | 6 | 7 | 1 | 2 | 9 | 5 | 3 | 8 | 4 |
Line 2: | 2 | 9 | 4 | 8 | 3 | 6 | 5 | 7 | 1 |
Line 3: | 8 | 3 | 5 | 4 | 7 | 1 | 9 | 6 | 2 |
Line 4: | 3 | 8 | 9 | 5 | 2 | 7 | 1 | 4 | 6 |
Line 5: | 5 | 2 | 7 | 1 | 6 | 4 | 8 | 9 | 3 |
Line 6: | 4 | 1 | 6 | 3 | 8 | 9 | 2 | 5 | 7 |
Line 7: | 9 | 6 | 2 | 7 | 5 | 3 | 4 | 1 | 8 |
Line 8: | 7 | 4 | 3 | 9 | 1 | 8 | 6 | 2 | 5 |
Line 9: | 1 | 5 | 8 | 6 | 4 | 2 | 7 | 3 | 9 |



Lenny

P.S.
The New Version of Extra Hard Sudoku's Solver in attachment:

Прикрепленные файлы


  • 0




Количество пользователей, читающих эту тему: 0

0 пользователей, 0 гостей, 0 анонимных

Яндекс.Метрика
Реклама на портале