Sudoku - Rebol/AGG Style
[1/10] from: james::mustard::co::nz at: 19-Oct-2005 15:11
I'll admit i'm a Sudoku addict ;)
Here's a little something i've been working on using Rebol/AGG/Draw only.
Please read the script header for how to use the program as I haven't
gotten around to fully documenting every thing yet.
Also please note the todo list before informing me that something is
horribly broken :)
I was very pleasantly surprised with the speed of the AGG drawing
- however i would be interested to hear from people as to how it
performed on their systems.
(stress tests performed here were done by fully loading the pencil
markings: set dothers: array/initial [9 9] "123456789" for full hints in
all square at launch)
Script: http://rebol.mustard.co.nz/sudoku.r
Have fun,
James.
PS: If anyone has spare time and wants to write a generator or solver to
plug in then great ;)
[2/10] from: james::mustard::co::nz at: 20-Oct-2005 15:45
UPDATE: I have temporarily plugged in an excellent C based generator and
solver by Guenter Stertenbrink into the application.
Its fast but using rebol's CALL to initiate the generator and solver is
an ugly hack.
I have placed the cpp files in the code directory of the new zip file -
PLEASE can someone rebolify this for me and send me an email so we can
make this purely rebol based - maybe even try the new rebcode VM?
latest sudoku-agg: http://rebol.mustard.co.nz/sudoku.zip
[3/10] from: SunandaDH::aol::com at: 20-Oct-2005 15:21
James:
> I'll admit i'm a Sudoku addict ;)
I think I've just recovered...but I lost a lot of coffee breaks to them in
the last few months.
> Script: http://rebol.mustard.co.nz/sudoku.r
do http://rebol.mustard.co.nz/sudoku.r
I get a window that says
Sudoku (Rebol Version)
- copyright
and nothing else and nothing happens.
That's with version 1.3.1.3.1
Sunanda
[4/10] from: james:mustard at: 20-Oct-2005 21:33
Hmm.. what OS? - and does it stop executing or does it crash?
Seems a little weird as that's the same rebol version im using -
OS: WindowsXP Pro
Would it be possible to find out where its dying?
Anyone else having this problem?
Regards,
Jamse.
[SunandaDH--aol--com] wrote:
[5/10] from: SunandaDH::aol::com at: 20-Oct-2005 17:18
James:
> Would it be possible to find out where its dying?
It's running under Windows 98
I started it up with
trace true
do http://rebol.mustard.co.nz/sudoku.r
and it seems to be in a loop:
=============
Trace: [
if not event? evt-func: evt-func face event [
return either evt-func [event] [none]
]
] (block)
Trace: if (word)
Trace: not (word)
Trace: event? (word)
Trace: evt-func: (set-word)
Trace: evt-func (word)
Trace: face (word)
Trace: event (word)
Trace: if (word)
Trace: all (word)
Trace: [
system/view/focal-face
event/type = 'down
not within? event/offset win-offset? system/view/focal-face
system/view/focal-face/size
system/view/focal-face/dirty?
] (block)
Trace: system/view/focal-face (path)
Trace: event/type (path)
Infix: op (equal?)
Trace: 'down (lit-word)
Result: none (none)
Trace: [
fac: system/view/focal-face
unfocus
if flag-face? fac on-unfocus [
do-face fac none
fac/dirty?: none
]
] (block)
Result: none (none)
Trace: event (word)
Result: (event)
Result: true (logic)
Result: false (logic)
Trace: [
return either evt-func [event] [none]
] (block)
Result: none (none)
Result: none (none)
Trace: event (word)
Result: (unset)
Trace: empty? (word)
Trace: screen-face/pane (path)
Result: false (logic)
Result: false (logic)
Result: false (logic)
Trace: wake-event (word)
Trace: port (word)
Trace: event: (set-word)
Trace: pick (word)
Trace: port (word)
Trace: 1 (integer)
Result: (event)
Trace: if (word)
Trace: none? (word)
Trace: event (word)
Result: false (logic)
Trace: [
if debug [print "Event port awoke, but no event was present."]
return false
] (block)
Result: none (none)
Trace: either (word)
Trace: pop-face (word)
Trace: [
if in pop-face/feel 'pop-detect [event: pop-face/feel/pop-detect pop-face
event]
do event
found? all [
pop-face <> pick pop-list length? pop-list
(pop-face: pick pop-list length? pop-list true)
]
] (block)
Trace: [
do event
empty? screen-face/pane
] (block)
Trace: do (word)
Trace: event (word)
Trace: foreach (word)
Trace: event-funcs (word)
Trace: [
if not event? evt-func: evt-func face event [
return either evt-func [event] [none]
]
=============
etc
Any help?
Sunanda
[6/10] from: james:mustard at: 21-Oct-2005 5:34
Hmm.. tried the same method of launching under winXP and it seemed to
work fine - is anyone else having this issue?
[SunandaDH--aol--com] wrote:
[7/10] from: carl::cybercraft::co::nz at: 21-Oct-2005 5:34
On Thursday, 20-October-2005 at 15:21:39 SunandaDH wrote,
>James:
>> I'll admit i'm a Sudoku addict ;)
<<quoted lines omitted: 7>>
>and nothing else and nothing happens.
>That's with version 1.3.1.3.1
I get the same with View 1.3.0 on Windows 98SE... A Win98 problem, perhaps?
-- Carl Read.
[8/10] from: james::mustard::co::nz at: 21-Oct-2005 13:38
It seems it may be a win98 problem - have tried it on Win2k, Win2k
server and WinXP and worked fine on all those..
I'll try a Win2k3 test tonight - at the moment i suspect something weird
may be happening on non-NT based windows versions.
Carl Read wrote:
[9/10] from: SunandaDH::aol::com at: 21-Oct-2005 8:55
James:
> Hmm.. tried the same method of launching under winXP and it seemed to
> work fine - is anyone else having this issue?
Icarii came up with a bright idea via Altme REBOL3.
Delete the copyright line, and it works.
Why a copyright symbol rendered in AGG under Win98 breaks things remains a
mystery.
Sunanda
[10/10] from: gabriele::colellachiara::com at: 21-Oct-2005 15:45
Hi SunandaDH,
On Friday, October 21, 2005, 2:55:24 PM, you wrote:
Sac> Why a copyright symbol rendered in AGG under Win98 breaks things remains a
Sac> mystery.
Font handling problems. Please report this to RAMBO, AGG's font
handling will need to be improved anyway (to work on other
platforms too).
Regards,
Gabriele.
--
Gabriele Santilli <[gabriele--rebol--com]> --- http://www.rebol.com/
Colella Chiara software division --- http://www.colellachiara.com/
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted