Merge remote-tracking branch 'origin/master' into modern-harvey2

modern-harvey2
Doug Coleman 2018-02-10 11:18:18 -06:00
commit ddcd6b2af0
113 changed files with 3004 additions and 370 deletions

View File

@ -1,4 +1,3 @@
language: cpp
compiler:
- clang
@ -45,4 +44,4 @@ before_install:
( cd udis86-1.7.2/ && ./autogen.sh && ./configure --enable-shared=yes && make && sudo make install ) &&
( [[ "$TRAVIS_OS_NAME" != "osx" ]] && sudo ldconfig || true )
script:
- ./build.sh net-bootstrap < /dev/null
- DEBUG=1 ./build.sh net-bootstrap < /dev/null

View File

@ -7,17 +7,17 @@ IN: cocoa.touchbar
: make-touchbar ( seq self -- touchbar )
[ NSTouchBar send: alloc send: init dup ] dip send: setDelegate: {
[ swap <CFStringArray> send: setDefaultItemIdentifiers: ]
[ swap <CFStringArray> send: setCustomizationAllowedItemIdentifiers: ]
[ swap <CFStringArray> send: \setDefaultItemIdentifiers: ]
[ swap <CFStringArray> send: \setCustomizationAllowedItemIdentifiers: ]
[ nip ]
} 2cleave ;
:: make-NSTouchBar-button ( self identifier label-string action-string -- button )
NSCustomTouchBarItem send: alloc
identifier <CFString> send: initWithIdentifier: :> item
identifier <CFString> send: \initWithIdentifier: :> item
NSButton
label-string <CFString>
self
action-string lookup-selector send: buttonWithTitle:target:action: :> button
item button send: setView:
action-string lookup-selector send: \buttonWithTitle:target:action: :> button
item button send: \setView:
item ;

View File

@ -13,7 +13,9 @@ LIBRARY: gdk
FUNCTION: Display* gdk_x11_display_get_xdisplay ( GdkDisplay* display )
: get-dpy ( -- dpy )
gdk_display_get_default gdk_x11_display_get_xdisplay ;
gdk_display_get_default [ gdk_x11_display_get_xdisplay ] [
"No default display." throw
] if* ;
M: gtk-game-input-backend (open-game-input)
reset-mouse ;

View File

@ -0,0 +1 @@
tools

View File

@ -355,6 +355,8 @@ M: word ($instance) dup name>> a/an write bl ($link) ;
M: string ($instance) write ;
M: array ($instance) print-element ;
M: f ($instance) ($link) ;
: $instance ( element -- ) first ($instance) ;

View File

@ -1,7 +1,28 @@
USING: help.markup help.syntax io kernel math quotations
opengl.gl multiline assocs strings ;
USING: help.markup help.syntax kernel opengl.gl quotations sequences
strings ;
IN: opengl.shaders
HELP: (gl-program)
{ $values
{ "shaders" sequence }
{ "quot" quotation }
} { $description
"Creates a gl program and attaches the shaders to it. Then applies the quotation to the program and finally links it."
}
{ $errors "Throws a gl error if linking the program fails." } ;
HELP: <gl-shader>
{ $values { "source" "The GLSL source code to compile" } { "kind" "The kind of shader to compile, such as " { $snippet "GL_VERTEX_SHADER" } " or " { $snippet "GL_FRAGMENT_SHADER" } } { "shader" "a new " { $link gl-shader } } }
{ $description "Tries to compile the given GLSL source into a shader object. The returned object can be checked for validity by " { $link check-gl-shader } " or " { $link gl-shader-ok? } ". Errors and warnings generated by the GLSL compiler will be collected in the info log, available from " { $link gl-shader-info-log } ".\n\nWhen the shader object is no longer needed, it should be deleted using " { $link glDeleteShader } " or else be attached to a " { $link gl-program } " object deleted using " { $link delete-gl-program } "." } ;
HELP: <vertex-shader>
{ $values { "source" "The GLSL source code to compile" } { "vertex-shader" "a new " { $link vertex-shader } } }
{ $description "Tries to compile the given GLSL source into a vertex shader object. Equivalent to " { $snippet "GL_VERTEX_SHADER <gl-shader>" } "." } ;
HELP: <fragment-shader>
{ $values { "source" "The GLSL source code to compile" } { "fragment-shader" "a new " { $link fragment-shader } } }
{ $description "Tries to compile the given GLSL source into a fragment shader object. Equivalent to " { $snippet "GL_FRAGMENT_SHADER <gl-shader>" } "." } ;
HELP: gl-shader
{ $class-description { $snippet "gl-shader" } " is a predicate class comprising values returned by OpenGL to represent shader objects. The following words are provided for creating and manipulating these objects:"
{ $list
@ -9,7 +30,7 @@ HELP: gl-shader
{ { $link gl-shader-ok? } " - Check whether a shader object compiled successfully" }
{ { $link check-gl-shader } " - Throw an error unless a shader object compiled successfully" }
{ { $link gl-shader-info-log } " - Retrieve the info log of messages generated by the GLSL compiler" }
{ { $link delete-gl-shader } " - Invalidate a shader object" }
{ { $link glDeleteShader } " - Invalidate a shader object" }
}
"The derived predicate classes " { $link vertex-shader } " and " { $link fragment-shader } " are also defined for the two standard kinds of shader defined by the OpenGL specification." } ;
@ -27,18 +48,6 @@ HELP: fragment-shader
}
} ;
HELP: <gl-shader>
{ $values { "source" "The GLSL source code to compile" } { "kind" "The kind of shader to compile, such as " { $snippet "GL_VERTEX_SHADER" } " or " { $snippet "GL_FRAGMENT_SHADER" } } { "shader" "a new " { $link gl-shader } } }
{ $description "Tries to compile the given GLSL source into a shader object. The returned object can be checked for validity by " { $link check-gl-shader } " or " { $link gl-shader-ok? } ". Errors and warnings generated by the GLSL compiler will be collected in the info log, available from " { $link gl-shader-info-log } ".\n\nWhen the shader object is no longer needed, it should be deleted using " { $link delete-gl-shader } " or else be attached to a " { $link gl-program } " object deleted using " { $link delete-gl-program } "." } ;
HELP: <vertex-shader>
{ $values { "source" "The GLSL source code to compile" } { "vertex-shader" "a new " { $link vertex-shader } } }
{ $description "Tries to compile the given GLSL source into a vertex shader object. Equivalent to " { $snippet "GL_VERTEX_SHADER <gl-shader>" } "." } ;
HELP: <fragment-shader>
{ $values { "source" "The GLSL source code to compile" } { "fragment-shader" "a new " { $link fragment-shader } } }
{ $description "Tries to compile the given GLSL source into a fragment shader object. Equivalent to " { $snippet "GL_FRAGMENT_SHADER <gl-shader>" } "." } ;
HELP: gl-shader-ok?
{ $values { "shader" "A " { $link gl-shader } " object" } { "?" boolean } }
{ $description "Returns a boolean value indicating whether the given shader object compiled successfully. Compilation errors and warnings are available in the shader's info log, which can be gotten using " { $link gl-shader-info-log } "." } ;
@ -47,10 +56,6 @@ HELP: check-gl-shader
{ $values { "shader" "A " { $link gl-shader } " object" } }
{ $description "Throws an error containing the " { $link gl-shader-info-log } " for the shader object if it failed to compile. Otherwise, the shader object is left on the stack." } ;
HELP: delete-gl-shader
{ $values { "shader" "A " { $link gl-shader } " object" } }
{ $description "Deletes the shader object, invalidating it and releasing any resources allocated for it by the OpenGL implementation." } ;
HELP: gl-shader-info-log
{ $values { "shader" "A " { $link gl-shader } " object" } { "log" string } }
{ $description "Retrieves the info log for " { $snippet "shader" } ", including any errors or warnings generated in compiling the shader object." } ;
@ -92,7 +97,7 @@ HELP: gl-program-info-log
HELP: delete-gl-program
{ $values { "program" "A " { $link gl-program } " object" } }
{ $description "Deletes the program object, invalidating it and releasing any resources allocated for it by the OpenGL implementation. Any attached " { $link gl-shader } "s are also deleted.\n\nIf the shader objects should be preserved, they should each be detached using " { $link detach-gl-program-shader } ". The program object can then be destroyed alone using " { $link delete-gl-program-only } "." } ;
{ $description "Deletes the program object, invalidating it and releasing any resources allocated for it by the OpenGL implementation. Any attached " { $link gl-shader } "s are also deleted.\n\nIf the shader objects should be preserved, they should each be detached using " { $link glDetachShader } ". The program object can then be destroyed alone using " { $link glDeleteProgram } "." } ;
HELP: with-gl-program
{ $values { "program" "A " { $link gl-program } " object" } { "quot" "A quotation with stack effect " { $snippet "( program -- )" } } }

View File

@ -54,24 +54,21 @@ IN: opengl.shaders
: check-gl-shader ( shader -- shader )
dup gl-shader-ok? [ dup gl-shader-info-log throw ] unless ;
: delete-gl-shader ( shader -- ) glDeleteShader ; inline
PREDICATE: gl-shader < integer (gl-shader?) ;
PREDICATE: vertex-shader < gl-shader (vertex-shader?) ;
PREDICATE: fragment-shader < gl-shader (fragment-shader?) ;
! Programs
: attach-shaders ( program shaders -- )
[ glAttachShader ] with each ;
: (gl-program) ( shaders quot: ( gl-program -- ) -- program )
glCreateProgram
[
[ swap [ glAttachShader ] with each ]
[ swap call ] bi-curry bi*
rot dupd attach-shaders swap call
] [ glLinkProgram ] [ ] tri gl-error ; inline
: <mrt-gl-program> ( shaders frag-data-locations -- program )
[ [ first2 swap glBindFragDataLocation ] with each ] curry (gl-program) ;
: <gl-program> ( shaders -- program )
[ drop ] (gl-program) ;
@ -111,23 +108,18 @@ PREDICATE: fragment-shader < gl-shader (fragment-shader?) ;
over uint <c-array>
[ glGetAttachedShaders ] keep [ zero? ] reject ;
: delete-gl-program-only ( program -- )
glDeleteProgram ; inline
: detach-gl-program-shader ( program shader -- )
glDetachShader ; inline
: delete-gl-program ( program -- )
dup gl-program-shaders [
2dup detach-gl-program-shader delete-gl-shader
] each delete-gl-program-only ;
2dup glDetachShader glDeleteShader
] each glDeleteProgram ;
: with-gl-program ( program quot -- )
over glUseProgram [ 0 glUseProgram ] [ ] cleanup ; inline
PREDICATE: gl-program < integer (gl-program?) ;
: <simple-gl-program> ( vertex-shader-source fragment-shader-source -- program )
: <simple-gl-program> ( vertex-shader-source fragment-shader-source
-- program )
[ <vertex-shader> check-gl-shader ]
[ <fragment-shader> check-gl-shader ] bi*
2array <gl-program> check-gl-program ;

View File

@ -10,12 +10,12 @@ IN: tools.deploy.config.editor
: deploy-config ( vocab -- assoc )
dup default-config swap
dup deploy-config-path vocab-file-contents
dup deploy-config-path vocab-file-lines
parse-fresh [ first assoc-union ] unless-empty ;
: set-deploy-config ( assoc vocab -- )
[ [ unparse-use ] without-limits string-lines ] dip
dup deploy-config-path set-vocab-file-contents ;
dup deploy-config-path set-vocab-file-lines ;
: set-deploy-flag ( value key vocab -- )
[ deploy-config [ set-at ] keep ] keep set-deploy-config ;

View File

@ -504,16 +504,14 @@ M:: gtk-ui-backend system-alert ( caption text -- )
] with-destructors ;
M: gtk-ui-backend (with-ui)
f f gtk_init_check [ "Unable to initialize GTK" throw ] unless
f f gtk_gl_init
load-icon
init-clipboard
start-ui
[
f f gtk_init
f f gtk_gl_init
load-icon
init-clipboard
start-ui
[
[ [ gtk_main ] with-timer ] with-event-loop
] with-destructors
] with-ui-running ;
[ [ gtk_main ] with-timer ] with-event-loop
] with-destructors ;
M: gtk-ui-backend stop-event-loop
gtk_main_quit ;

View File

@ -706,13 +706,11 @@ M: windows-ui-backend set-title ( string world -- )
M: windows-ui-backend (with-ui)
[
[
init-clipboard
init-win32-ui
start-ui
event-loop
] [ cleanup-win32-ui ] [ ] cleanup
] with-ui-running ;
init-clipboard
init-win32-ui
start-ui
event-loop
] [ cleanup-win32-ui ] [ ] cleanup ;
M: windows-ui-backend beep ( -- )
0 MessageBeep drop ;

View File

@ -319,15 +319,13 @@ M: x11-handle flush-gl-context ( handle -- )
dpy get swap window>> glXSwapBuffers ;
M: x11-ui-backend (with-ui) ( quot -- )
[
f [
[
init-clipboard
start-ui
event-loop
] with-xim
] with-x
] with-ui-running ;
f [
[
init-clipboard
start-ui
event-loop
] with-xim
] with-x ;
M: x11-ui-backend beep ( -- )
dpy get 100 XBell drop ;

View File

@ -3,7 +3,6 @@ math.rectangles namespaces quotations sequences strings ui.backend
ui.gadgets ui.gadgets.books ui.gadgets.grids ui.gadgets.packs
ui.gadgets.private ui.gadgets.tracks ui.gadgets.worlds ui.private ui.text
vocabs.loader ;
IN: ui
HELP: close-window
@ -91,7 +90,10 @@ HELP: raise-window
HELP: with-ui
{ $values { "quot" { $quotation ( -- ) } } }
{ $description "Calls the quotation, starting the UI if necessary. If starting the UI is necessary, this word does not return and the UI will start after the quotation returns." }
{ $description
"Calls the quotation, starting the UI if necessary. If starting the UI is necessary, this word does not return and the UI will start after the quotation returns." $nl
"While the combinator is running, " { $link ui-running? } " can be used by user code to determine whether it is running in a UI context or not."
}
{ $notes "This word should be used in the " { $link postpone: \MAIN: } " word of an application that uses the UI in order for the vocabulary to work when run from either the UI listener (" { $snippet "\"my-app\" run" } ") and the command line (" { $snippet "./factor -run=my-app" } ")." }
{ $examples "The " { $vocab-link "hello-ui" } " vocabulary implements a simple UI application which uses this word." } ;

2
basis/ui/ui-tests.factor Normal file
View File

@ -0,0 +1,2 @@
USING: assocs continuations kernel threads tools.test ui ;
IN: ui.tests

View File

@ -134,10 +134,6 @@ M: world ungraft*
SYMBOL: ui-running
: with-ui-running ( quot -- )
t ui-running set-global
[ f ui-running set-global ] [ ] cleanup ; inline
PRIVATE>
: find-windows ( quot: ( world -- ? ) -- seq )
@ -225,7 +221,15 @@ M: object resize-window 2drop ;
[ find-world [ dup pref-dim resize-window ] when* ] bi ;
: with-ui ( quot: ( -- ) -- )
ui-running? [ call( -- ) ] [ '[ init-ui @ ] (with-ui) ] if ;
ui-running? [ call( -- ) ] [
t ui-running set-global '[
[ init-ui @ ] (with-ui)
] [
f ui-running set-global
! Give running ui threads a chance to finish.
notify-ui-thread yield
] [ ] cleanup
] if ;
HOOK: beep ui-backend ( -- )

View File

@ -9,7 +9,7 @@ IN: vocabs.cache
vocab-name
[ root-cache get delete-at ]
[
\ vocab-file-contents "memoize" word-prop swap
\ vocab-file-lines "memoize" word-prop swap
'[ drop first vocab-name _ = ] assoc-reject! drop
] bi
\ all-disk-vocabs-recursive reset-memoized

View File

@ -32,18 +32,18 @@ ARTICLE: "vocabs.metadata" "Vocabulary metadata"
}
"Getting and setting arbitrary vocabulary metadata:"
{ $subsections
vocab-file-contents
set-vocab-file-contents
vocab-file-lines
set-vocab-file-lines
} ;
ABOUT: "vocabs.metadata"
HELP: vocab-file-contents
{ $values { "vocab" "a vocabulary specifier" } { "name" string } { "seq" { $maybe "a sequence of lines" } } }
{ $description "Outputs the contents of the file named " { $snippet "name" } " from the vocabulary's directory, or " { $link f } " if the file does not exist." } ;
HELP: vocab-file-lines
{ $values { "vocab" "a vocabulary specifier" } { "name" string } { "lines" { $maybe { $sequence "lines" } } } }
{ $description "Outputs the lines of the file named " { $snippet "name" } " from the vocabulary's directory, or " { $link f } " if the file does not exist." } ;
HELP: set-vocab-file-contents
{ $values { "seq" "a sequence of lines" } { "vocab" "a vocabulary specifier" } { "name" string } }
HELP: set-vocab-file-lines
{ $values { "lines" { $sequence "lines" } } { "vocab" "a vocabulary specifier" } { "name" string } }
{ $description "Stores a sequence of lines to the file named " { $snippet "name" } " from the vocabulary's directory." } ;
HELP: vocab-summary

View File

@ -10,7 +10,7 @@ IN: vocabs.metadata
: check-vocab ( vocab -- vocab )
dup find-vocab-root [ no-vocab ] unless ;
MEMO: vocab-file-contents ( vocab name -- seq )
MEMO: vocab-file-lines ( vocab name -- lines/f )
vocab-append-path dup [
dup exists? [
utf8 file-lines harvest
@ -19,23 +19,23 @@ MEMO: vocab-file-contents ( vocab name -- seq )
] if
] when ;
: set-vocab-file-contents ( seq vocab name -- )
: set-vocab-file-lines ( lines vocab name -- )
dupd vocab-append-path [
swap [ ?delete-file ] [ swap utf8 set-file-lines ] if-empty
\ vocab-file-contents reset-memoized
\ vocab-file-lines reset-memoized
] [ vocab-name no-vocab ] ?if ;
: vocab-resources-path ( vocab -- string )
vocab-dir "resources.txt" append-path ;
: vocab-resources ( vocab -- patterns )
dup vocab-resources-path vocab-file-contents ;
dup vocab-resources-path vocab-file-lines ;
: vocab-summary-path ( vocab -- string )
vocab-dir "summary.txt" append-path ;
: vocab-summary ( vocab -- summary )
dup dup vocab-summary-path vocab-file-contents
dup dup vocab-summary-path vocab-file-lines
[
vocab-name " vocabulary" append
] [
@ -56,13 +56,13 @@ M: vocab-link summary vocab-summary ;
vocab-dir "tags.txt" append-path ;
: vocab-tags ( vocab -- tags )
dup vocab-tags-path vocab-file-contents ;
dup vocab-tags-path vocab-file-lines ;
: vocab-authors-path ( vocab -- string )
vocab-dir "authors.txt" append-path ;
: vocab-authors ( vocab -- authors )
dup vocab-authors-path vocab-file-contents ;
dup vocab-authors-path vocab-file-lines ;
: vocab-platforms-path ( vocab -- string )
vocab-dir "platforms.txt" append-path ;
@ -70,7 +70,7 @@ M: vocab-link summary vocab-summary ;
ERROR: bad-platform name ;
: vocab-platforms ( vocab -- platforms )
dup vocab-platforms-path vocab-file-contents
dup vocab-platforms-path vocab-file-lines
[ dup "system" lookup-word [ ] [ bad-platform ] ?if ] map ;
: supported-platform? ( platforms -- ? )

View File

@ -33,10 +33,12 @@ ERROR: resource-missing pattern ;
'[ _ match-pattern ] gather ;
: vocab-resource-files ( vocab -- filenames )
[ vocab-resources ] [ vocab-dir-in-root ] bi
[
match-patterns [ expand-resource ] map concat
] with-directory-files ;
dup vocab-resources [
swap vocab-dir-in-root
[
match-patterns [ expand-resource ] map concat
] with-directory-files
] [ drop f ] if* ;
: copy-vocab-resources ( dir vocab -- )
dup vocab-resource-files

View File

@ -1,7 +1,7 @@
! Copyright (C) 2009 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors assocs calendar fry kernel locals parser
sequences vocabs words memoize ;
sequences vocabs words ;
IN: calendar.holidays
SINGLETONS: all world commonwealth-of-nations ;
@ -15,7 +15,10 @@ SYNTAX: \HOLIDAY:
parse-definition ( timestamp/n -- timestamp ) define-declared ;
SYNTAX: \HOLIDAY-NAME:
let[ scan-word "holiday" word-prop :> holidays scan-word :> name scan-object :> value
let[
scan-word "holiday" word-prop :> holidays
scan-word :> name
scan-object :> value
value name holidays set-at ] ;
>>
@ -24,16 +27,14 @@ GENERIC: holidays ( n singleton -- seq )
<PRIVATE
: (holidays) ( singleton -- seq )
all-words swap '[ "holiday" word-prop _ swap key? ] filter ;
all-words [ "holiday" word-prop key? ] with filter ;
M: object holidays
(holidays) [ execute( timestamp -- timestamp' ) ] with map ;
PRIVATE>
M: all holidays
drop
all-words [ "holiday" word-prop key? ] with filter ;
M: all holidays drop (holidays) ;
: holiday? ( timestamp/n singleton -- ? )
[ holidays ] [ drop ] 2bi '[ _ same-day? ] any? ;

View File

@ -50,10 +50,10 @@ IN: fuel.eval.tests
] unit-test
{
"(nil nil \"9\\n\")\n<~FUEL~>\n"
"(nil 9 \"\")\n<~FUEL~>\n"
} [
[
{ "3 sq . " } "hi99"
{ "math" "prettyprint" "kernel" } eval-in-context
{ "3 sq" } "hi99"
{ "math" "kernel" } eval-in-context
] with-string-writer
] unit-test

View File

@ -1,6 +1,6 @@
! Copyright (C) 2009 Jose Antonio Ortega Ruiz.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays continuations debugger fuel.pprint io
USING: accessors arrays continuations debugger fry fuel.pprint io
io.streams.string kernel listener namespaces parser.notes
prettyprint.config sequences sets vocabs.parser ;
IN: fuel.eval
@ -8,9 +8,6 @@ IN: fuel.eval
SYMBOL: restarts-stack
V{ } clone restarts-stack set-global
SYMBOL: eval-result
f eval-result set-global
SYMBOL: eval-res-flag
t eval-res-flag set-global
@ -31,14 +28,14 @@ t eval-res-flag set-global
"<~FUEL~>" write nl flush ;
: begin-eval ( -- )
f eval-result set-global push-status ;
push-status ;
: end-eval ( error/f output -- )
eval-result get-global swap send-retort pop-status ;
: end-eval ( result error/f output -- )
swapd send-retort pop-status ;
: eval ( lines -- error/f )
[ parse-lines-interactive call( -- ) f ] curry
[ dup print-error ] recover ;
: eval ( lines -- result error/f )
'[ _ parse-lines-interactive call( -- x ) f ]
[ dup print-error f swap ] recover ;
: eval-usings ( usings -- )
[ [ use-vocab ] curry ignore-errors ] each ;

View File

@ -28,6 +28,6 @@ IN: fuel.tests
[ make-uses-restart is-suggested-restart? ] with-variable
] unit-test
{ } [
{ f } [
{ "kernel" } [ "\\ dup drop" eval( -- ) ] fuel-use-suggested-vocabs
] unit-test

View File

@ -1,13 +1,12 @@
! Copyright (C) 2008, 2009 Jose Antonio Ortega Ruiz.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors assocs compiler.units continuations fuel.eval
USING: accessors assocs compiler.units continuations fry fuel.eval
fuel.help fuel.xref help.topics io.pathnames kernel namespaces parser
parser.notes sequences tools.scaffold vocabs vocabs.files
parser.notes sequences source-files tools.scaffold vocabs vocabs.files
vocabs.hierarchy vocabs.loader vocabs.metadata vocabs.parser words ;
IN: fuel
! Evaluation
: fuel-eval-restartable ( -- )
t eval-res-flag set-global ; inline
@ -17,9 +16,6 @@ IN: fuel
: fuel-eval-in-context ( lines in usings -- )
eval-in-context ;
: fuel-eval-set-result ( obj -- )
clone eval-result set-global ; inline
: fuel-retort ( -- ) f f "" send-retort ; inline
! Loading files
@ -44,134 +40,147 @@ SYMBOL: :uses-suggestions
restarts get [ is-suggested-restart? ] filter
dup length 1 = [ first continue-restart ] [ drop ] if ;
: set-use-hook ( -- )
[ manifest get auto-used>> clone :uses prefix fuel-eval-set-result ]
print-use-hook set ;
SYMBOL: auto-uses
: get-uses ( lines -- )
: set-use-hook ( -- )
[
parser-quiet? on
parse-fresh drop
] curry with-compilation-unit ; inline
manifest get auto-used>> clone :uses prefix
clone auto-uses set-global
] print-use-hook set ;
PRIVATE>
: fuel-use-suggested-vocabs ( ..a suggestions quot: ( ..a -- ..b ) -- ..b )
: fuel-use-suggested-vocabs ( ..a suggestions quot: ( ..a -- ..b )
-- ..b result )
f auto-uses set-global
[ :uses-suggestions set ] dip
[ try-suggested-restarts rethrow ] recover ; inline
[ try-suggested-restarts rethrow ] recover
auto-uses get-global ; inline
: fuel-run-file ( path -- )
[ set-use-hook run-file ] curry with-scope ; inline
: fuel-run-file ( path -- result )
f auto-uses set-global
'[ set-use-hook _ run-file ] with-scope
auto-uses get-global ; inline
: fuel-with-autouse ( ..a quot: ( ..a -- ..b ) -- ..b )
[ set-use-hook call ] curry with-scope ; inline
'[ set-use-hook _ call ] with-scope ; inline
: fuel-get-uses ( lines -- )
[ get-uses ] curry fuel-with-autouse ;
: fuel-get-uses ( name lines -- )
'[
[
_ [
parser-quiet? on
_ parse-fresh drop
] with-source-file
] with-compilation-unit
] fuel-with-autouse ;
! Edit locations
: fuel-get-word-location ( word -- result )
word-location ;
: fuel-get-word-location ( word -- )
word-location fuel-eval-set-result ;
: fuel-get-vocab-location ( vocab -- result )
vocab-location ;
: fuel-get-vocab-location ( vocab -- )
vocab-location fuel-eval-set-result ;
: fuel-get-doc-location ( word -- result )
doc-location ;
: fuel-get-doc-location ( word -- )
doc-location fuel-eval-set-result ;
: fuel-get-article-location ( name -- result )
article-location ;
: fuel-get-article-location ( name -- )
article-location fuel-eval-set-result ;
: fuel-get-vocabs ( -- reuslt )
all-disk-vocab-names ;
: fuel-get-vocabs ( -- )
all-disk-vocab-names fuel-eval-set-result ;
: fuel-get-vocabs/prefix ( prefix -- result )
get-vocabs/prefix ;
: fuel-get-vocabs/prefix ( prefix -- )
get-vocabs/prefix fuel-eval-set-result ;
: fuel-get-words ( prefix names -- )
get-vocabs-words/prefix fuel-eval-set-result ;
: fuel-get-words ( prefix names -- result )
get-vocabs-words/prefix ;
! Cross-references
: fuel-callers-xref ( word -- ) callers-xref fuel-eval-set-result ;
: fuel-callers-xref ( word -- result ) callers-xref ;
: fuel-callees-xref ( word -- ) callees-xref fuel-eval-set-result ;
: fuel-callees-xref ( word -- result ) callees-xref ;
: fuel-apropos-xref ( str -- ) apropos-xref fuel-eval-set-result ;
: fuel-apropos-xref ( str -- result ) apropos-xref ;
: fuel-vocab-xref ( vocab -- ) vocab-xref fuel-eval-set-result ;
: fuel-vocab-xref ( vocab -- result ) vocab-xref ;
: fuel-vocab-uses-xref ( vocab -- ) vocab-uses-xref fuel-eval-set-result ;
: fuel-vocab-uses-xref ( vocab -- result ) vocab-uses-xref ;
: fuel-vocab-usage-xref ( vocab -- ) vocab-usage-xref fuel-eval-set-result ;
: fuel-vocab-usage-xref ( vocab -- result ) vocab-usage-xref ;
! Help support
: fuel-get-article ( name -- ) fuel.help::get-article fuel-eval-set-result ;
: fuel-get-article ( name -- result )
fuel.help:get-article ;
: fuel-get-article-title ( name -- )
articles get at [ article-title ] [ f ] if* fuel-eval-set-result ;
: fuel-get-article-title ( name -- result )
articles get at [ article-title ] [ f ] if* ;
: fuel-word-help ( name -- ) word-help fuel-eval-set-result ;
: fuel-word-help ( name -- result ) word-help ;
: fuel-word-def ( name -- ) word-def fuel-eval-set-result ;
: fuel-word-def ( name -- result ) word-def ;
: fuel-vocab-help ( name -- ) fuel.help::vocab-help fuel-eval-set-result ;
: fuel-vocab-help ( name -- result ) fuel.help:vocab-help ;
: fuel-word-synopsis ( word -- ) word-synopsis fuel-eval-set-result ;
: fuel-word-synopsis ( word -- synopsis )
word-synopsis ;
: fuel-vocab-summary ( name -- )
fuel.help::vocab-summary fuel-eval-set-result ;
: fuel-vocab-summary ( name -- summary )
fuel.help:vocab-summary ;
: fuel-index ( quot -- ) call( -- seq ) format-index fuel-eval-set-result ;
: fuel-index ( quot -- result )
call( -- seq ) format-index ;
: fuel-get-vocabs/tag ( tag -- )
get-vocabs/tag fuel-eval-set-result ;
: fuel-get-vocabs/tag ( tag -- result )
get-vocabs/tag ;
: fuel-get-vocabs/author ( author -- )
get-vocabs/author fuel-eval-set-result ;
: fuel-get-vocabs/author ( author -- result )
get-vocabs/author ;
! Scaffold support
: scaffold-name ( devname -- )
[ developer-name set ] when* ;
: fuel-scaffold-vocab ( root name devname -- )
: fuel-scaffold-vocab ( root name devname -- result )
[ scaffold-name dup [ scaffold-vocab ] dip ] with-scope
dup require vocab-source-path absolute-path fuel-eval-set-result ;
dup require vocab-source-path absolute-path ;
: fuel-scaffold-help ( name devname -- )
: fuel-scaffold-help ( name devname -- result )
[ scaffold-name dup require dup scaffold-docs ] with-scope
vocab-docs-path absolute-path fuel-eval-set-result ;
vocab-docs-path absolute-path ;
: fuel-scaffold-tests ( name devname -- )
: fuel-scaffold-tests ( name devname -- result )
[ scaffold-name dup require dup scaffold-tests ] with-scope
vocab-tests-file absolute-path fuel-eval-set-result ;
vocab-tests-file absolute-path ;
: fuel-scaffold-authors ( name devname -- )
: fuel-scaffold-authors ( name devname -- result )
[ scaffold-name dup require dup scaffold-authors ] with-scope
[ vocab-authors-path ] keep swap vocab-append-path absolute-path fuel-eval-set-result ;
[ vocab-authors-path ] keep swap vocab-append-path absolute-path ;
: fuel-scaffold-tags ( name tags -- )
: fuel-scaffold-tags ( name tags -- result )
[ scaffold-tags ]
[
drop [ vocab-tags-path ] keep swap
vocab-append-path absolute-path fuel-eval-set-result
vocab-append-path absolute-path
] 2bi ;
: fuel-scaffold-summary ( name summary -- )
: fuel-scaffold-summary ( name summary -- result )
[ scaffold-summary ]
[
drop [ vocab-summary-path ] keep swap
vocab-append-path absolute-path fuel-eval-set-result
vocab-append-path absolute-path
] 2bi ;
: fuel-scaffold-platforms ( name platforms -- )
: fuel-scaffold-platforms ( name platforms -- result )
[ scaffold-platforms ]
[
drop [ vocab-platforms-path ] keep swap
vocab-append-path absolute-path fuel-eval-set-result
vocab-append-path absolute-path
] 2bi ;
: fuel-scaffold-get-root ( name -- ) find-vocab-root fuel-eval-set-result ;
: fuel-scaffold-get-root ( name -- result )
find-vocab-root ;

View File

@ -1,10 +1,11 @@
! Copyright (C) 2009 Jose Antonio Ortega Ruiz.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays assocs combinators combinators.short-circuit
fry help help.crossref help.markup help.markup.private help.topics
help.vocabs io io.streams.string kernel make namespaces parser
prettyprint see sequences splitting summary vocabs vocabs.hierarchy
vocabs.metadata vocabs.parser words ;
USING: accessors arrays assocs combinators
combinators.short-circuit help help.crossref help.markup
help.markup.private help.topics help.vocabs io io.streams.string
kernel make namespaces parser prettyprint see sequences
splitting summary vocabs vocabs.hierarchy vocabs.metadata
vocabs.parser words ;
IN: fuel.help
SYMBOLS: $doc-path $next-link $prev-link $fuel-nav-crumbs ;
@ -35,7 +36,7 @@ SYMBOLS: $doc-path $next-link $prev-link $fuel-nav-crumbs ;
<PRIVATE
: find-word ( name -- word/f )
{ [ search ] [ '[ name>> _ = ] all-words swap find nip ] } 1|| ;
{ [ search ] [ words-named ?first ] } 1|| ;
: definition-str ( word -- str )
[ see ] with-string-writer ; inline

View File

@ -42,6 +42,9 @@ FUNCTION: int gdbm_exists ( GDBM_FILE dbf, datum key )
FUNCTION: int gdbm_setopt ( GDBM_FILE dbf, int option, int* value, int size )
FUNCTION: int gdbm_fdesc ( GDBM_FILE dbf )
! Removed in gdbm 1.14
C-GLOBAL: int gdbm_errno
! Added in gdbm 1.14
FUNCTION: int *gdbm_errno_location ( )
FUNCTION: c-string gdbm_strerror ( int errno )

View File

@ -1,8 +1,8 @@
! Copyright (C) 2010 Dmitry Shubin.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors alien.c-types alien.data alien.destructors
alien.enums alien.syntax classes.struct combinators destructors
fry gdbm.ffi io.backend kernel libc locals math namespaces
alien.enums alien.syntax classes.struct combinators continuations
destructors fry gdbm.ffi io.backend kernel libc locals math namespaces
sequences serialize strings ;
IN: gdbm
@ -41,10 +41,12 @@ ENUM: gdbm-error
gdbm-option-already-set
gdbm-illegal-option ;
<PRIVATE
: gdbm-throw ( -- * ) gdbm_errno gdbm-error number>enum throw ;
: gdbm-errno ( -- n )
[ gdbm_errno ] [ drop gdbm_errno_location int deref ] recover ;
: gdbm-throw ( -- * ) gdbm-errno gdbm-error number>enum throw ;
: check-error ( ret -- ) 0 = [ gdbm-throw ] unless ;

View File

@ -1,7 +1,7 @@
! Copyright (C) 2015 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: fry git io io.directories io.encodings.utf8 io.files.temp
io.files.unique io.launcher kernel sequences tools.test ;
USING: accessors fry git io io.directories io.encodings.utf8
io.launcher io.streams.string kernel sequences tools.test ;
IN: git.tests
: run-process-stdout ( process -- string )
@ -21,6 +21,12 @@ IN: git.tests
@
] with-empty-test-git-repo ; inline
{ "hello" } [
commit new "author" "hello\r\n"
[ parse-commit-field ] with-string-reader
author>>
] unit-test
{ "refs/heads/master" } [
[ git-head-ref ] with-empty-test-git-repo
] unit-test

View File

@ -148,11 +148,6 @@ CONSTRUCTOR: <tree> tree ( -- obj ) ;
ERROR: unknown-commit-line line name ;
ERROR: string-expected got expected ;
: expect-string ( string expected -- )
2dup = [ 2drop ] [ string-expected ] if ;
ERROR: eof-too-early ;
ERROR: unknown-field field ;
@ -175,13 +170,11 @@ ERROR: unexpected-text text ;
} case ;
: parse-commit ( bytes -- commit )
" " split1 [ "commit" expect-string ] [ string>number read ] bi*
" " split1 [ "commit" assert= ] [ string>number read ] bi*
utf8 [
commit new parse-commit-lines
] with-byte-reader ;
: parse-tree-field ( obj parameter -- obj )
[ "\r\n" read-until* ] dip {
{ "tree" [ >>tree ] }
@ -504,8 +497,6 @@ ERROR: repeated-parent-hash hash ;
H{ } clone parents [
git-head-object [
parents>> dup string? [ random ] unless [
! [ parents get 2dup key? [ repeated-parent-hash ] when dupd set-at ] keep
! dup "parent: " prepend print flush yield
dup git-unpacked-object-exists?
[ git-read-object ] [ git-object-from-pack ] if
] [ f ] if*

View File

@ -0,0 +1,23 @@
! Copyright (C) 2018 Björn Lindqvist.
! See http://factorcode.org/license.txt for BSD license.
USING: help.markup help.syntax ;
IN: google.gmail
ARTICLE: "google.gmail" "GMail Client"
"This vocab implements an api to GMail based on " { $vocab-link "oauth2" } "."
$nl
"To use the vocab, it first needs to be supplied the 'Client ID' and 'Client secret settings' using the " { $link configure-oauth2 } " vord:"
{ $unchecked-example
"\"client-id\" \"client-secret\" configure-oauth2"
}
"The settings can be found on Google's developer console at " { $url "https://console.developers.google.com" } ". Then the authenticated users labels can be listed using:"
{ $unchecked-example
"list-labels"
}
"Or to list the first message in the users inbox:"
{ $unchecked-example
"\"INBOX\" list-messages-by-label \"messages\" of"
"first \"id\" of { } get-messages"
} ;
ABOUT: "google.gmail"

View File

@ -11,20 +11,20 @@ CONSTANT: token-uri "https://www.googleapis.com/oauth2/v4/token"
CONSTANT: redirect-uri "urn:ietf:wg:oauth:2.0:oob"
CONSTANT: gmail-scope-ro "https://www.googleapis.com/auth/gmail.readonly"
SYMBOL: access-token
SYMBOLS: access-token google-oauth2 ;
: configure-oauth2 ( client-id client-secret -- )
[ auth-uri token-uri redirect-uri ] 2dip gmail-scope-ro { }
oauth2 boa oauth2 set ;
oauth2 boa google-oauth2 set ;
: ensure-token ( -- )
access-token [
[
dup access-expired? [
oauth2 get over refresh-flow update-tokens
google-oauth2 get over refresh-flow update-tokens
] when
] [
oauth2 get console-flow
google-oauth2 get console-flow
] if*
] change ;

View File

@ -1,6 +1,6 @@
! Copyright (C) 2009 Joe Groff.
! See http://factorcode.org/license.txt for BSD license.
USING: help.markup help.syntax ui.gadgets.worlds ;
USING: gpu.private help.markup help.syntax ui.gadgets.worlds ;
IN: gpu
HELP: finish-gpu
@ -15,6 +15,9 @@ HELP: flush-gpu
HELP: gpu-object
{ $class-description "Parent class of all GPU resources." } ;
HELP: has-vertex-array-objects?
{ $var-description "Whether the opengl version supports Vertex Array Objects or not." } ;
HELP: init-gpu
{ $description "Initializes the current graphics context for use with the " { $snippet "gpu" } " library. This should be the first thing called in a world's " { $link begin-world } " method." } ;

View File

@ -1,9 +1,17 @@
! Copyright (C) 2009 Joe Groff.
! See http://factorcode.org/license.txt for BSD license.
USING: classes classes.struct gpu.buffers help.markup help.syntax
images kernel math multiline quotations sequences strings words ;
USING: classes classes.struct gpu.buffers gpu.shaders.private
help.markup help.syntax images math sequences strings words ;
IN: gpu.shaders
HELP: <multi-vertex-array>
{ $values
{ "vertex-formats" "a list of " { $link buffer-ptr } "/" { $link vertex-format } " pairs" }
{ "program-instance" program-instance }
{ "vertex-array" vertex-array }
}
{ $description "Creates a new " { $link vertex-array } " to feed data to " { $snippet "program-instance" } " from the set of " { $link buffer } "s specified in " { $snippet "vertex-formats" } ". The first element of each pair in " { $snippet "vertex-formats" } " can be either a " { $link buffer-ptr } " or a " { $link buffer } "; in the latter case, vertex data in the associated format is read from the beginning of the buffer." } ;
HELP: <program-instance>
{ $values
{ "program" program }
@ -18,13 +26,13 @@ HELP: <shader-instance>
}
{ $description "Compiles an instance of " { $snippet "shader" } " for the current graphics context. If an instance already exists for " { $snippet "shader" } " in the current context, it is reused." } ;
HELP: <multi-vertex-array>
HELP: <vertex-array-object>
{ $values
{ "vertex-formats" "a list of " { $link buffer-ptr } "/" { $link vertex-format } " pairs" }
{ "program-instance" program-instance }
{ "vertex-array" vertex-array }
{ "vertex-buffer" "a vertex buffer" }
{ "program-instance" program-instance }
{ "format" vertex-format }
}
{ $description "Creates a new " { $link vertex-array } " to feed data to " { $snippet "program-instance" } " from the set of " { $link buffer } "s specified in " { $snippet "vertex-formats" } ". The first element of each pair in " { $snippet "vertex-formats" } " can be either a " { $link buffer-ptr } " or a " { $link buffer } "; in the latter case, vertex data in the associated format is read from the beginning of the buffer." } ;
{ $description "Creates a new vertex array object." } ;
HELP: \feedback-format:
{ $syntax "feedback-format: vertex-format" }
@ -32,7 +40,7 @@ HELP: \feedback-format:
HELP: \GLSL-PROGRAM:
{ $syntax "GLSL-PROGRAM: program-name shader shader ... [vertex-format vertex-format ...] [feedback-format: vertex-format] ;" }
{ $description "Defines a new " { $link program } " named " { $snippet "program-name" } ". When the program is instantiated with " { $link <program-instance> } ", it will link together instances of all of the specified " { $link shader } "s to create the program instance. If any " { $link vertex-format } "s are specified, their attributes will be pre-assigned attribute indexes at link time, to ensure that their indexes remain constant if the program is refreshed with " { $link refresh-program } ". A transform feedback vertex format may optionally be specified with " { $link postpone: \feedback-format: } "; if the program is used to collect transform feedback, the given vertex format will be used for the output." }
{ $description "Defines a new shader " { $link program } " named " { $snippet "program-name" } ". When the program is instantiated with " { $link <program-instance> } ", it will link together instances of all of the specified " { $link shader } "s to create the program instance. If any " { $link vertex-format } "s are specified, their attributes will be pre-assigned attribute indexes at link time, to ensure that their indexes remain constant if the program is refreshed with " { $link refresh-program } ". A transform feedback vertex format may optionally be specified with " { $link POSTPONE: feedback-format: } "; if the program is used to collect transform feedback, the given vertex format will be used for the output." }
{ $notes "Transform feedback requires OpenGL 3.0 or one of the " { $snippet "GL_EXT_transform_feedback" } " or " { $snippet "GL_ARB_transform_feedback" } " extensions." } ;
HELP: \GLSL-SHADER-FILE:

View File

@ -1,6 +1,6 @@
! Copyright (C) 2009 Joe Groff.
! See http://factorcode.org/license.txt for BSD license.
USING: multiline gpu.shaders gpu.shaders.private tools.test ;
USING: gpu.shaders gpu.shaders.private io.pathnames tools.test ;
IN: gpu.shaders.tests
{ "ERROR: foo.factor:20: Bad command or filename
@ -10,3 +10,9 @@ NOT:A:LOG:LINE" }
"ERROR: 0:1: Bad command or filename
INFO: 0:11: The operation completed successfully
NOT:A:LOG:LINE" replace-log-line-numbers ] unit-test
SYMBOL: a-test-symbol
{ "shaders" } [
a-test-symbol word-directory file-name
] unit-test

View File

@ -456,7 +456,7 @@ TUPLE: compile-shader-error shader log ;
TUPLE: link-program-error program log ;
: throw-compile-shader-error ( shader instance -- * )
[ dup ] dip [ gl-shader-info-log ] [ delete-gl-shader ] bi
[ dup ] dip [ gl-shader-info-log ] [ glDeleteShader ] bi
replace-log-line-numbers compile-shader-error boa throw ;
: throw-link-program-error ( program instance -- * )
@ -494,11 +494,14 @@ DEFER: <shader-instance>
: link-program ( program -- program-instance )
dup shaders>> [ <shader-instance> ] map (link-program) ;
: word-directory ( word -- directory )
where first parent-directory ;
: in-word's-path ( word kind filename -- word kind filename' )
[ over ] dip [ where first parent-directory ] dip append-path ;
pick word-directory prepend-path ;
: become-shader-instance ( shader-instance new-shader-instance -- )
handle>> [ swap delete-gl-shader ] curry change-handle drop ;
handle>> [ swap glDeleteShader ] curry change-handle drop ;
: refresh-shader-source ( shader -- )
dup filename>>
@ -506,7 +509,7 @@ DEFER: <shader-instance>
[ drop ] if* ;
: become-program-instance ( program-instance new-program-instance -- )
handle>> [ swap delete-gl-program-only ] curry change-handle drop ;
handle>> [ swap glDeleteProgram ] curry change-handle drop ;
: reset-memos ( -- )
\ uniform-index reset-memoized
@ -622,11 +625,11 @@ SYNTAX: \GLSL-PROGRAM:
define-constant ;
M: shader-instance dispose
[ dup valid-handle? [ delete-gl-shader ] [ drop ] if f ] change-handle
[ dup valid-handle? [ glDeleteShader ] [ drop ] if f ] change-handle
[ world>> ] [ shader>> instances>> ] [ ] tri ?delete-at ;
M: program-instance dispose
[ dup valid-handle? [ delete-gl-program-only ] [ drop ] if f ] change-handle
[ dup valid-handle? [ glDeleteProgram ] [ drop ] if f ] change-handle
[ world>> ] [ program>> instances>> ] [ ] tri ?delete-at
reset-memos ;

View File

@ -0,0 +1,5 @@
USING: help.markup help.syntax ;
IN: gpu.util
HELP: window-vertex-format
{ $class-description "A vertex format for screen coordinates." } ;

View File

@ -0,0 +1,11 @@
USING: help.markup help.syntax math ;
IN: gpu.util.wasd
HELP: wasd-world
{ $class-description "A wasd-world is a 3d world in which the camera can move using the keybindings 'w', 'a', 's' and 'd' and the view can rotate using the camera." } ;
HELP: wasd-near-plane
{ $values
{ "world" wasd-world }
{ "near-plane" float }
} { $description "Near plane of the 3d world." } ;

View File

@ -1,7 +1,7 @@
! Copyright (C) 2010 Anton Gorenko.
! See http://factorcode.org/license.txt for BSD license.
USING: alien.strings gdk.gl.ffi gobject.ffi gtk.ffi gtk.gl.ffi
io.encodings.utf8 kernel locals opengl.gl ;
io.encodings.utf8 kernel locals opengl.demo-support opengl.gl ;
IN: gtk-samples.opengl
! This sample is based on
@ -25,14 +25,14 @@ IN: gtk-samples.opengl
[
GL_COLOR_BUFFER_BIT glClear
GL_TRIANGLES glBegin
1.0 0.0 0.0 glColor3f
0 1 glVertex2i
0.0 1.0 0.0 glColor3f
-1 -1 glVertex2i
0.0 0.0 1.0 glColor3f
1 -1 glVertex2i
glEnd
GL_TRIANGLES [
1.0 0.0 0.0 glColor3f
0 1 glVertex2i
0.0 1.0 0.0 glColor3f
-1 -1 glVertex2i
0.0 0.0 1.0 glColor3f
1 -1 glVertex2i
] do-state
gl-drawable gdk_gl_drawable_is_double_buffered 1 =
[ gl-drawable gdk_gl_drawable_swap_buffers ]

View File

@ -0,0 +1 @@
Cat Stevens

View File

@ -0,0 +1,183 @@
USING: help help.lint.coverage help.lint.coverage.private
help.markup help.syntax io kernel sequences strings vocabs words ;
IN: help.lint.coverage
<PRIVATE
: $related-subsections ( element -- )
[ related-words ] [ $subsections ] bi ;
PRIVATE>
ABOUT: "help.lint.coverage"
ARTICLE: "help.lint.coverage" "Help coverage linting"
"The " { $vocab-link "help.lint.coverage" } " vocabulary implements a very picky documentation completeness checker."
$nl
"The documentation coverage linter requires most words to have " { $link postpone: \HELP: } " declarations defining some of the "
{ $links $values $description $error-description $class-description $examples } " sections (see " { $links "element-types" } ")."
$nl
"This vocabulary is intended to be used alongside and after " { $vocab-link "help.lint" } ", not as a replacement for it."
$nl
"These words are provided to aid in writing more complete documentation:"
{ $related-subsections
word-help-coverage.
vocab-help-coverage.
prefix-help-coverage.
}
"Coverage report objects:"
{ $related-subsections
word-help-coverage
help-coverage.
}
"Raw report generation:"
{ $related-subsections
<word-help-coverage>
<vocab-help-coverage>
<prefix-help-coverage>
} ;
{ word-help-coverage word-help-coverage. <word-help-coverage> <vocab-help-coverage> <prefix-help-coverage> }
related-words
HELP: word-help-coverage
{ $class-description "A documentation coverage report for a single word." } ;
HELP: help-coverage.
{ $values { "coverage" word-help-coverage } }
{ $contract "Displays a coverage object." }
{ $examples
{ $example
"USING: help.lint.coverage ;"
"\\ <word-help-coverage> <word-help-coverage> help-coverage."
"[help.lint.coverage] <word-help-coverage>: full help coverage"
}
} ;
HELP: word-help-coverage.
{ $values { "word-spec" { $or word string } } }
{ $description "Prettyprints a help coverage report of " { $snippet "word-spec" } " to " { $link output-stream } "." }
{ $examples
{ $example
"USING: sequences help.lint.coverage ;"
"\\ map word-help-coverage."
"[sequences] map: needs help section: $examples"
}
} ;
HELP: vocab-help-coverage.
{ $values { "vocab-spec" { $or vocab string } } }
{ $description "Prettyprints a help coverage report of " { $snippet "vocab-spec" } " to " { $link output-stream } "." }
{ $examples
{ $example
"USING: help.lint.coverage ;"
"\"english\" vocab-help-coverage."
"[english] a10n: needs help sections: $description $examples
[english] count-of-things: needs help sections: $description $examples
[english] pluralize: needs help sections: $description $examples
[english] singularize: needs help sections: $description $examples
0.0% of words have complete documentation"
}
} ;
HELP: prefix-help-coverage.
{ $values { "prefix-spec" { $or vocab string } } { "private?" boolean } }
{ $description "Prettyprints a help coverage report of " { $snippet "prefix-spec" } " to " { $link output-stream } "." }
{ $examples
{ $example
"USING: help.lint.coverage ;"
"\"english\" t prefix-help-coverage."
"[english] a10n: needs help sections: $description $examples
[english] count-of-things: needs help sections: $description $examples
[english] pluralize: needs help sections: $description $examples
[english] singularize: needs help sections: $description $examples
[english.private] match-case: needs help sections: $description $examples
[english.private] plural-to-singular: needs help sections: $description $examples
[english.private] singular-to-plural: needs help sections: $description $examples
0.0% of words have complete documentation"
}
} ;
HELP: <prefix-help-coverage>
{ $values { "prefix" string } { "private?" boolean } { "coverage" sequence } }
{ $description "Runs the help coverage checker on every child vocabulary of the given " { $snippet "prefix" } ", including the base vocabulary. If " { $snippet "private?" } " is " { $snippet "f" } ", the prefix's child " { $snippet ".private" } " vocabularies are not checked. If " { $snippet "private?" } " is " { $snippet "t" } ", " { $emphasis "all" } " child vocabularies are checked." }
{ $examples
{ $example
"USING: help.lint.coverage prettyprint ;"
"\"english\" t <prefix-help-coverage> ."
"{
T{ word-help-coverage
{ word-name a10n }
{ omitted-sections { $description $examples } }
}
T{ word-help-coverage
{ word-name count-of-things }
{ omitted-sections { $description $examples } }
}
T{ word-help-coverage
{ word-name pluralize }
{ omitted-sections { $description $examples } }
}
T{ word-help-coverage
{ word-name singularize }
{ omitted-sections { $description $examples } }
}
T{ word-help-coverage
{ word-name match-case }
{ omitted-sections { $description $examples } }
}
T{ word-help-coverage
{ word-name plural-to-singular }
{ omitted-sections { $description $examples } }
}
T{ word-help-coverage
{ word-name singular-to-plural }
{ omitted-sections { $description $examples } }
}
}"
}
} ;
HELP: <word-help-coverage>
{ $values { "word" { $or string word } } { "coverage" word-help-coverage } }
{ $contract "Looks up a word in the current scope and generates a documentation coverage report for it."}
{ $examples
{ $example
"USING: help.lint.coverage prettyprint ;"
"\\ <word-help-coverage> <word-help-coverage> ."
"T{ word-help-coverage
{ word-name <word-help-coverage> }
{ 100%-coverage? t }
}"
}
} ;
HELP: <vocab-help-coverage>
{ $values { "vocab-spec" { $or vocab string } } { "coverage" sequence } }
{ $description "Runs the help coverage checker on the vocabulary in the given " { $snippet "vocab-spec" } "." }
{ $examples
{ $example
"USING: help.lint.coverage prettyprint ;"
"\"english\" <vocab-help-coverage> ."
"{
T{ word-help-coverage
{ word-name a10n }
{ omitted-sections { $description $examples } }
}
T{ word-help-coverage
{ word-name count-of-things }
{ omitted-sections { $description $examples } }
}
T{ word-help-coverage
{ word-name pluralize }
{ omitted-sections { $description $examples } }
}
T{ word-help-coverage
{ word-name singularize }
{ omitted-sections { $description $examples } }
}
}"
}
} ;

View File

@ -0,0 +1,68 @@
USING: accessors help.lint.coverage help.lint.coverage.private
help.markup help.syntax kernel literals math math.matrices
sequences sorting tools.test vocabs ;
IN: help.lint.coverage.tests
<PRIVATE
: empty ( a v -- x y ) ;
: nonexistent ( a v -- x y ) ;
: defined ( x -- x ) ;
HELP: empty { $examples } ;
HELP: nonexistent ;
HELP: defined { $examples { $example "USING: prettyprint ; " "1 ." "1" } } ;
PRIVATE>
{ t } [ \ empty empty-examples? ] unit-test
{ f } [ \ nonexistent empty-examples? ] unit-test
{ f } [ \ defined empty-examples? ] unit-test
{ f } [ \ keep empty-examples? ] unit-test
{ { $description $values } } [ \ empty missing-sections natural-sort ] unit-test
{ { $description $values } } [ \ defined missing-sections natural-sort ] unit-test
{ { } } [ \ keep missing-sections ] unit-test
{ { "a.b" "a.b.c" } } [ { "a.b" "a.b.private" "a.b.c.private" "a.b.c" } filter-private ] unit-test
{ "sections" } [ 0 "section" ?pluralize ] unit-test
{ "section" } [ 1 "section" ?pluralize ] unit-test
{ "sections" } [ 10 "section" ?pluralize ] unit-test
{ { $examples } } [ \ empty word-defines-sections ] unit-test
{ { $examples } } [ \ defined word-defines-sections ] unit-test
{ { } } [ \ nonexistent word-defines-sections ] unit-test
{ { $values $description $examples } } [ \ keep word-defines-sections ] unit-test
{ { $values $contract $examples } } [ \ <word-help-coverage> word-defines-sections ] unit-test
{ eye } [ "eye" find-word ] unit-test
{
V{ "[" { $[ "math" dup lookup-vocab ] } "] " { "zero?" zero? } ": " }
} [
V{ } clone \ zero? (assemble-word-metadata)
] unit-test
{
V{ "empty " { "$examples" $examples } "; " }
} [
V{ } clone word-help-coverage new t >>empty-examples? (assemble-empty-examples)
] unit-test
{
V{ "needs help " "sections: " { { "$description" $description } { "$examples" $examples } } }
} [
V{ } clone word-help-coverage new { $description $examples } >>omitted-sections (assemble-omitted-sections)
] unit-test
{
V{ "needs help " "section: " { { "$description" $description } } }
} [
V{ } clone word-help-coverage new { $description } >>omitted-sections (assemble-omitted-sections)
] unit-test
{
V{ "full help coverage" }
} [
V{ } clone word-help-coverage new t >>100%-coverage? (assemble-full-coverage)
] unit-test
! make sure this doesn't throw an error (would signify an issue with ignored-words)
! the contents of all-words is not important
{ } [ all-words [ <word-help-coverage> ] map drop ] unit-test

View File

@ -0,0 +1,155 @@
USING: accessors arrays assocs classes classes.error combinators
continuations english formatting fry generic help
help.lint.checks help.markup io io.streams.string io.styles
kernel math namespaces parser sequences sequences.deep sets
sorting splitting strings summary vocabs vocabs.parser words ;
FROM: namespaces => set ;
IN: help.lint.coverage
TUPLE: word-help-coverage
{ word-name word initial: postpone: f }
{ omitted-sections sequence initial: { } }
{ empty-examples? boolean initial: f }
{ 100%-coverage? boolean initial: f } ;
<PRIVATE
CONSTANT: ignored-words {
$low-level-note
$prettyprinting-note
$values-x/y
$parsing-note
$io-error
$shuffle
$complex-shuffle
$nl
}
DEFER: ?pluralize
: write-object-seq ( object-seq -- )
[
dup array? [
dup ?first array?
[ dup length '[
swap first2 write-object
_ 1 - abs = not [ " " write ] when
] each-index
] [ first2 write-object ] if
] [ write ] if
] each ; inline
: (assemble-word-metadata) ( vec word -- vec )
[
[ "[" ] dip vocabulary>> dup lookup-vocab 2array "] "
3array over push-all
] [
[ name>> ] keep 2array ": "
2array over push-all
] bi ; inline
: (assemble-empty-examples) ( vec coverage -- vec )
empty-examples?>> [ "empty " \ $examples [ name>> ] keep 2array "; "
3array over push-all
] when ;
: (assemble-omitted-sections) ( vec coverage -- vec )
omitted-sections>> [
length "section" ?pluralize ": " append
] [
[ [ name>> ] keep 2array ] map
] bi
[ "needs help " ] 2dip
3array over push-all ;
: (assemble-full-coverage) ( vec coverage -- vec )
drop "full help coverage" over push ;
: (present-coverage) ( coverage-report -- )
[ V{ } clone ] dip
[ word-name>> (assemble-word-metadata) ] keep
dup 100%-coverage?>>
[ (assemble-full-coverage) ] [
[ (assemble-empty-examples) ]
[ (assemble-omitted-sections) ] bi
] if "\n" over push write-object-seq ;
M: word-help-coverage summary
[ (present-coverage) ] with-string-writer ; inline
: sorted-loaded-child-vocabs ( prefix -- assoc )
loaded-child-vocab-names natural-sort ; inline
: filter-private ( seq -- no-private )
[ ".private" ?tail nip not ] filter ; inline
: ?pluralize ( n singular -- singular/plural )
count-of-things " " split1 nip ;
: should-define ( word -- spec )
{
{ [ dup predicate? ] [ drop { } ] } ! predicate?s have generated docs
{ [ dup error-class? ] [ drop { $values $description $error-description } ] }
{ [ dup class? ] [ drop { $class-description } ] }
{ [ dup generic? ] [ drop { $values $contract $examples } ] }
{ [ dup word? ] [ drop { $values $description $examples } ] }
[ drop no-cond ]
} cond ;
: word-defines-sections ( word -- seq )
word-help [ ignored-words member? not ] filter [ ?first ] map ;
! only words that need examples, need to have them nonempty
! not defining examples is not the same as an empty { $examples }
: empty-examples? ( word -- ? )
word-help \ $examples swap elements [ f ] [ first rest empty? ] if-empty ;
: missing-sections ( word -- missing )
[ should-define ] [ word-defines-sections ] bi diff ;
: find-word ( name -- word/f )
dup words-named dup length {
{ 0 [ 2drop f ] }
{ 1 [ first nip ] }
[ drop <ambiguous-use-error> throw-restarts ]
} case ;
PRIVATE>
GENERIC: <word-help-coverage> ( word -- coverage )
M: word <word-help-coverage>
dup [ missing-sections ] [ empty-examples? ] bi
2dup 2array { { } f } =
word-help-coverage boa ; inline
M: string <word-help-coverage>
find-word <word-help-coverage> ; inline
: <vocab-help-coverage> ( vocab-spec -- coverage )
[ auto-use? off vocab-words natural-sort [ <word-help-coverage> ] map ] with-scope ;
: <prefix-help-coverage> ( prefix private? -- coverage )
[
auto-use? off group-articles vocab-articles set
[ sorted-loaded-child-vocabs ] dip not
[ filter-private ] when
[ <vocab-help-coverage> ] map flatten
] with-scope ;
GENERIC: help-coverage. ( coverage -- )
M: sequence help-coverage.
[
[ help-coverage. ] each
] [
[ [ 100%-coverage?>> ] count ] [ length ] bi /f
100 *
"\n%3.1f%% of words have complete documentation\n"
printf
] bi ; recursive
M: word-help-coverage help-coverage.
(present-coverage) ;
: word-help-coverage. ( word-spec -- ) <word-help-coverage> help-coverage. ;
: vocab-help-coverage. ( vocab-spec -- ) <vocab-help-coverage> help-coverage. ;
: prefix-help-coverage. ( prefix-spec private? -- ) <prefix-help-coverage> help-coverage. ;

View File

@ -0,0 +1 @@
Documentation coverage linter

View File

@ -0,0 +1 @@
tools

View File

@ -7,7 +7,7 @@ kernel math.parser sequences splitting ;
IN: machine-learning.data-sets
TUPLE: data-set data target target-names description
feature-names ;
feature-names ;
C: <data-set> data-set
@ -17,18 +17,30 @@ C: <data-set> data-set
"resource:extra/machine-learning/data-sets/" prepend
utf8 file-contents ;
: load-tabular-file ( name -- lines )
load-file [ blank? ] trim string-lines
[ [ blank? ] split-when harvest ] map harvest ;
: numerify ( table -- data names )
unclip [ [ [ string>number ] map ] map ] dip ;
: load-table ( name -- data names )
load-file [ blank? ] trim string-lines
[ [ blank? ] split-when ] map numerify ;
load-tabular-file numerify ;
: load-table-csv ( name -- data names )
load-file string>csv numerify ;
PRIVATE>
: load-monks ( name -- data-set )
load-tabular-file
! Omits the identifiers which are not so interesting.
[ but-last [ string>number ] map ] map
[ [ rest ] map ] [ [ first ] map ] bi
{ "no" "yes" }
"monks.names" load-file
{ "a1" "a2" "a3" "a4" "a5" "a6" } <data-set> ;
: load-iris ( -- data-set )
"iris.csv" load-table-csv
[ [ unclip-last ] { } map>assoc unzip ] [ 2 tail ] bi*

View File

@ -0,0 +1,432 @@
1 1 1 1 1 1 1 data_1
1 1 1 1 1 1 2 data_2
1 1 1 1 1 2 1 data_3
1 1 1 1 1 2 2 data_4
1 1 1 1 1 3 1 data_5
1 1 1 1 1 3 2 data_6
1 1 1 1 1 4 1 data_7
1 1 1 1 1 4 2 data_8
1 1 1 1 2 1 1 data_9
1 1 1 1 2 1 2 data_10
1 1 1 1 2 2 1 data_11
1 1 1 1 2 2 2 data_12
1 1 1 1 2 3 1 data_13
1 1 1 1 2 3 2 data_14
1 1 1 1 2 4 1 data_15
1 1 1 1 2 4 2 data_16
1 1 1 1 3 1 1 data_17
1 1 1 1 3 1 2 data_18
1 1 1 1 3 2 1 data_19
1 1 1 1 3 2 2 data_20
1 1 1 1 3 3 1 data_21
1 1 1 1 3 3 2 data_22
1 1 1 1 3 4 1 data_23
1 1 1 1 3 4 2 data_24
1 1 1 2 1 1 1 data_25
1 1 1 2 1 1 2 data_26
1 1 1 2 1 2 1 data_27
1 1 1 2 1 2 2 data_28
1 1 1 2 1 3 1 data_29
1 1 1 2 1 3 2 data_30
1 1 1 2 1 4 1 data_31
1 1 1 2 1 4 2 data_32
1 1 1 2 2 1 1 data_33
1 1 1 2 2 1 2 data_34
1 1 1 2 2 2 1 data_35
1 1 1 2 2 2 2 data_36
1 1 1 2 2 3 1 data_37
1 1 1 2 2 3 2 data_38
1 1 1 2 2 4 1 data_39
1 1 1 2 2 4 2 data_40
1 1 1 2 3 1 1 data_41
1 1 1 2 3 1 2 data_42
1 1 1 2 3 2 1 data_43
1 1 1 2 3 2 2 data_44
1 1 1 2 3 3 1 data_45
1 1 1 2 3 3 2 data_46
1 1 1 2 3 4 1 data_47
1 1 1 2 3 4 2 data_48
1 1 2 1 1 1 1 data_49
1 1 2 1 1 1 2 data_50
0 1 2 1 1 2 1 data_51
0 1 2 1 1 2 2 data_52
0 1 2 1 1 3 1 data_53
0 1 2 1 1 3 2 data_54
0 1 2 1 1 4 1 data_55
0 1 2 1 1 4 2 data_56
1 1 2 1 2 1 1 data_57
1 1 2 1 2 1 2 data_58
0 1 2 1 2 2 1 data_59
0 1 2 1 2 2 2 data_60
0 1 2 1 2 3 1 data_61
0 1 2 1 2 3 2 data_62
0 1 2 1 2 4 1 data_63
0 1 2 1 2 4 2 data_64
1 1 2 1 3 1 1 data_65
1 1 2 1 3 1 2 data_66
0 1 2 1 3 2 1 data_67
0 1 2 1 3 2 2 data_68
0 1 2 1 3 3 1 data_69
0 1 2 1 3 3 2 data_70
0 1 2 1 3 4 1 data_71
0 1 2 1 3 4 2 data_72
1 1 2 2 1 1 1 data_73
1 1 2 2 1 1 2 data_74
0 1 2 2 1 2 1 data_75
0 1 2 2 1 2 2 data_76
0 1 2 2 1 3 1 data_77
0 1 2 2 1 3 2 data_78
0 1 2 2 1 4 1 data_79
0 1 2 2 1 4 2 data_80
1 1 2 2 2 1 1 data_81
1 1 2 2 2 1 2 data_82
0 1 2 2 2 2 1 data_83
0 1 2 2 2 2 2 data_84
0 1 2 2 2 3 1 data_85
0 1 2 2 2 3 2 data_86
0 1 2 2 2 4 1 data_87
0 1 2 2 2 4 2 data_88
1 1 2 2 3 1 1 data_89
1 1 2 2 3 1 2 data_90
0 1 2 2 3 2 1 data_91
0 1 2 2 3 2 2 data_92
0 1 2 2 3 3 1 data_93
0 1 2 2 3 3 2 data_94
0 1 2 2 3 4 1 data_95
0 1 2 2 3 4 2 data_96
1 1 3 1 1 1 1 data_97
1 1 3 1 1 1 2 data_98
0 1 3 1 1 2 1 data_99
0 1 3 1 1 2 2 data_100
0 1 3 1 1 3 1 data_101
0 1 3 1 1 3 2 data_102
0 1 3 1 1 4 1 data_103
0 1 3 1 1 4 2 data_104
1 1 3 1 2 1 1 data_105
1 1 3 1 2 1 2 data_106
0 1 3 1 2 2 1 data_107
0 1 3 1 2 2 2 data_108
0 1 3 1 2 3 1 data_109
0 1 3 1 2 3 2 data_110
0 1 3 1 2 4 1 data_111
0 1 3 1 2 4 2 data_112
1 1 3 1 3 1 1 data_113
1 1 3 1 3 1 2 data_114
0 1 3 1 3 2 1 data_115
0 1 3 1 3 2 2 data_116
0 1 3 1 3 3 1 data_117
0 1 3 1 3 3 2 data_118
0 1 3 1 3 4 1 data_119
0 1 3 1 3 4 2 data_120
1 1 3 2 1 1 1 data_121
1 1 3 2 1 1 2 data_122
0 1 3 2 1 2 1 data_123
0 1 3 2 1 2 2 data_124
0 1 3 2 1 3 1 data_125
0 1 3 2 1 3 2 data_126
0 1 3 2 1 4 1 data_127
0 1 3 2 1 4 2 data_128
1 1 3 2 2 1 1 data_129
1 1 3 2 2 1 2 data_130
0 1 3 2 2 2 1 data_131
0 1 3 2 2 2 2 data_132
0 1 3 2 2 3 1 data_133
0 1 3 2 2 3 2 data_134
0 1 3 2 2 4 1 data_135
0 1 3 2 2 4 2 data_136
1 1 3 2 3 1 1 data_137
1 1 3 2 3 1 2 data_138
0 1 3 2 3 2 1 data_139
0 1 3 2 3 2 2 data_140
0 1 3 2 3 3 1 data_141
0 1 3 2 3 3 2 data_142
0 1 3 2 3 4 1 data_143
0 1 3 2 3 4 2 data_144
1 2 1 1 1 1 1 data_145
1 2 1 1 1 1 2 data_146
0 2 1 1 1 2 1 data_147
0 2 1 1 1 2 2 data_148
0 2 1 1 1 3 1 data_149
0 2 1 1 1 3 2 data_150
0 2 1 1 1 4 1 data_151
0 2 1 1 1 4 2 data_152
1 2 1 1 2 1 1 data_153
1 2 1 1 2 1 2 data_154
0 2 1 1 2 2 1 data_155
0 2 1 1 2 2 2 data_156
0 2 1 1 2 3 1 data_157
0 2 1 1 2 3 2 data_158
0 2 1 1 2 4 1 data_159
0 2 1 1 2 4 2 data_160
1 2 1 1 3 1 1 data_161
1 2 1 1 3 1 2 data_162
0 2 1 1 3 2 1 data_163
0 2 1 1 3 2 2 data_164
0 2 1 1 3 3 1 data_165
0 2 1 1 3 3 2 data_166
0 2 1 1 3 4 1 data_167
0 2 1 1 3 4 2 data_168
1 2 1 2 1 1 1 data_169
1 2 1 2 1 1 2 data_170
0 2 1 2 1 2 1 data_171
0 2 1 2 1 2 2 data_172
0 2 1 2 1 3 1 data_173
0 2 1 2 1 3 2 data_174
0 2 1 2 1 4 1 data_175
0 2 1 2 1 4 2 data_176
1 2 1 2 2 1 1 data_177
1 2 1 2 2 1 2 data_178
0 2 1 2 2 2 1 data_179
0 2 1 2 2 2 2 data_180
0 2 1 2 2 3 1 data_181
0 2 1 2 2 3 2 data_182
0 2 1 2 2 4 1 data_183
0 2 1 2 2 4 2 data_184
1 2 1 2 3 1 1 data_185
1 2 1 2 3 1 2 data_186
0 2 1 2 3 2 1 data_187
0 2 1 2 3 2 2 data_188
0 2 1 2 3 3 1 data_189
0 2 1 2 3 3 2 data_190
0 2 1 2 3 4 1 data_191
0 2 1 2 3 4 2 data_192
1 2 2 1 1 1 1 data_193
1 2 2 1 1 1 2 data_194
1 2 2 1 1 2 1 data_195
1 2 2 1 1 2 2 data_196
1 2 2 1 1 3 1 data_197
1 2 2 1 1 3 2 data_198
1 2 2 1 1 4 1 data_199
1 2 2 1 1 4 2 data_200
1 2 2 1 2 1 1 data_201
1 2 2 1 2 1 2 data_202
1 2 2 1 2 2 1 data_203
1 2 2 1 2 2 2 data_204
1 2 2 1 2 3 1 data_205
1 2 2 1 2 3 2 data_206
1 2 2 1 2 4 1 data_207
1 2 2 1 2 4 2 data_208
1 2 2 1 3 1 1 data_209
1 2 2 1 3 1 2 data_210
1 2 2 1 3 2 1 data_211
1 2 2 1 3 2 2 data_212
1 2 2 1 3 3 1 data_213
1 2 2 1 3 3 2 data_214
1 2 2 1 3 4 1 data_215
1 2 2 1 3 4 2 data_216
1 2 2 2 1 1 1 data_217
1 2 2 2 1 1 2 data_218
1 2 2 2 1 2 1 data_219
1 2 2 2 1 2 2 data_220
1 2 2 2 1 3 1 data_221
1 2 2 2 1 3 2 data_222
1 2 2 2 1 4 1 data_223
1 2 2 2 1 4 2 data_224
1 2 2 2 2 1 1 data_225
1 2 2 2 2 1 2 data_226
1 2 2 2 2 2 1 data_227
1 2 2 2 2 2 2 data_228
1 2 2 2 2 3 1 data_229
1 2 2 2 2 3 2 data_230
1 2 2 2 2 4 1 data_231
1 2 2 2 2 4 2 data_232
1 2 2 2 3 1 1 data_233
1 2 2 2 3 1 2 data_234
1 2 2 2 3 2 1 data_235
1 2 2 2 3 2 2 data_236
1 2 2 2 3 3 1 data_237
1 2 2 2 3 3 2 data_238
1 2 2 2 3 4 1 data_239
1 2 2 2 3 4 2 data_240
1 2 3 1 1 1 1 data_241
1 2 3 1 1 1 2 data_242
0 2 3 1 1 2 1 data_243
0 2 3 1 1 2 2 data_244
0 2 3 1 1 3 1 data_245
0 2 3 1 1 3 2 data_246
0 2 3 1 1 4 1 data_247
0 2 3 1 1 4 2 data_248
1 2 3 1 2 1 1 data_249
1 2 3 1 2 1 2 data_250
0 2 3 1 2 2 1 data_251
0 2 3 1 2 2 2 data_252
0 2 3 1 2 3 1 data_253
0 2 3 1 2 3 2 data_254
0 2 3 1 2 4 1 data_255
0 2 3 1 2 4 2 data_256
1 2 3 1 3 1 1 data_257
1 2 3 1 3 1 2 data_258
0 2 3 1 3 2 1 data_259
0 2 3 1 3 2 2 data_260
0 2 3 1 3 3 1 data_261
0 2 3 1 3 3 2 data_262
0 2 3 1 3 4 1 data_263
0 2 3 1 3 4 2 data_264
1 2 3 2 1 1 1 data_265
1 2 3 2 1 1 2 data_266
0 2 3 2 1 2 1 data_267
0 2 3 2 1 2 2 data_268
0 2 3 2 1 3 1 data_269
0 2 3 2 1 3 2 data_270
0 2 3 2 1 4 1 data_271
0 2 3 2 1 4 2 data_272
1 2 3 2 2 1 1 data_273
1 2 3 2 2 1 2 data_274
0 2 3 2 2 2 1 data_275
0 2 3 2 2 2 2 data_276
0 2 3 2 2 3 1 data_277
0 2 3 2 2 3 2 data_278
0 2 3 2 2 4 1 data_279
0 2 3 2 2 4 2 data_280
1 2 3 2 3 1 1 data_281
1 2 3 2 3 1 2 data_282
0 2 3 2 3 2 1 data_283
0 2 3 2 3 2 2 data_284
0 2 3 2 3 3 1 data_285
0 2 3 2 3 3 2 data_286
0 2 3 2 3 4 1 data_287
0 2 3 2 3 4 2 data_288
1 3 1 1 1 1 1 data_289
1 3 1 1 1 1 2 data_290
0 3 1 1 1 2 1 data_291
0 3 1 1 1 2 2 data_292
0 3 1 1 1 3 1 data_293
0 3 1 1 1 3 2 data_294
0 3 1 1 1 4 1 data_295
0 3 1 1 1 4 2 data_296
1 3 1 1 2 1 1 data_297
1 3 1 1 2 1 2 data_298
0 3 1 1 2 2 1 data_299
0 3 1 1 2 2 2 data_300
0 3 1 1 2 3 1 data_301
0 3 1 1 2 3 2 data_302
0 3 1 1 2 4 1 data_303
0 3 1 1 2 4 2 data_304
1 3 1 1 3 1 1 data_305
1 3 1 1 3 1 2 data_306
0 3 1 1 3 2 1 data_307
0 3 1 1 3 2 2 data_308
0 3 1 1 3 3 1 data_309
0 3 1 1 3 3 2 data_310
0 3 1 1 3 4 1 data_311
0 3 1 1 3 4 2 data_312
1 3 1 2 1 1 1 data_313
1 3 1 2 1 1 2 data_314
0 3 1 2 1 2 1 data_315
0 3 1 2 1 2 2 data_316
0 3 1 2 1 3 1 data_317
0 3 1 2 1 3 2 data_318
0 3 1 2 1 4 1 data_319
0 3 1 2 1 4 2 data_320
1 3 1 2 2 1 1 data_321
1 3 1 2 2 1 2 data_322
0 3 1 2 2 2 1 data_323
0 3 1 2 2 2 2 data_324
0 3 1 2 2 3 1 data_325
0 3 1 2 2 3 2 data_326
0 3 1 2 2 4 1 data_327
0 3 1 2 2 4 2 data_328
1 3 1 2 3 1 1 data_329
1 3 1 2 3 1 2 data_330
0 3 1 2 3 2 1 data_331
0 3 1 2 3 2 2 data_332
0 3 1 2 3 3 1 data_333
0 3 1 2 3 3 2 data_334
0 3 1 2 3 4 1 data_335
0 3 1 2 3 4 2 data_336
1 3 2 1 1 1 1 data_337
1 3 2 1 1 1 2 data_338
0 3 2 1 1 2 1 data_339
0 3 2 1 1 2 2 data_340
0 3 2 1 1 3 1 data_341
0 3 2 1 1 3 2 data_342
0 3 2 1 1 4 1 data_343
0 3 2 1 1 4 2 data_344
1 3 2 1 2 1 1 data_345
1 3 2 1 2 1 2 data_346
0 3 2 1 2 2 1 data_347
0 3 2 1 2 2 2 data_348
0 3 2 1 2 3 1 data_349
0 3 2 1 2 3 2 data_350
0 3 2 1 2 4 1 data_351
0 3 2 1 2 4 2 data_352
1 3 2 1 3 1 1 data_353
1 3 2 1 3 1 2 data_354
0 3 2 1 3 2 1 data_355
0 3 2 1 3 2 2 data_356
0 3 2 1 3 3 1 data_357
0 3 2 1 3 3 2 data_358
0 3 2 1 3 4 1 data_359
0 3 2 1 3 4 2 data_360
1 3 2 2 1 1 1 data_361
1 3 2 2 1 1 2 data_362
0 3 2 2 1 2 1 data_363
0 3 2 2 1 2 2 data_364
0 3 2 2 1 3 1 data_365
0 3 2 2 1 3 2 data_366
0 3 2 2 1 4 1 data_367
0 3 2 2 1 4 2 data_368
1 3 2 2 2 1 1 data_369
1 3 2 2 2 1 2 data_370
0 3 2 2 2 2 1 data_371
0 3 2 2 2 2 2 data_372
0 3 2 2 2 3 1 data_373
0 3 2 2 2 3 2 data_374
0 3 2 2 2 4 1 data_375
0 3 2 2 2 4 2 data_376
1 3 2 2 3 1 1 data_377
1 3 2 2 3 1 2 data_378
0 3 2 2 3 2 1 data_379
0 3 2 2 3 2 2 data_380
0 3 2 2 3 3 1 data_381
0 3 2 2 3 3 2 data_382
0 3 2 2 3 4 1 data_383
0 3 2 2 3 4 2 data_384
1 3 3 1 1 1 1 data_385
1 3 3 1 1 1 2 data_386
1 3 3 1 1 2 1 data_387
1 3 3 1 1 2 2 data_388
1 3 3 1 1 3 1 data_389
1 3 3 1 1 3 2 data_390
1 3 3 1 1 4 1 data_391
1 3 3 1 1 4 2 data_392
1 3 3 1 2 1 1 data_393
1 3 3 1 2 1 2 data_394
1 3 3 1 2 2 1 data_395
1 3 3 1 2 2 2 data_396
1 3 3 1 2 3 1 data_397
1 3 3 1 2 3 2 data_398
1 3 3 1 2 4 1 data_399
1 3 3 1 2 4 2 data_400
1 3 3 1 3 1 1 data_401
1 3 3 1 3 1 2 data_402
1 3 3 1 3 2 1 data_403
1 3 3 1 3 2 2 data_404
1 3 3 1 3 3 1 data_405
1 3 3 1 3 3 2 data_406
1 3 3 1 3 4 1 data_407
1 3 3 1 3 4 2 data_408
1 3 3 2 1 1 1 data_409
1 3 3 2 1 1 2 data_410
1 3 3 2 1 2 1 data_411
1 3 3 2 1 2 2 data_412
1 3 3 2 1 3 1 data_413
1 3 3 2 1 3 2 data_414
1 3 3 2 1 4 1 data_415
1 3 3 2 1 4 2 data_416
1 3 3 2 2 1 1 data_417
1 3 3 2 2 1 2 data_418
1 3 3 2 2 2 1 data_419
1 3 3 2 2 2 2 data_420
1 3 3 2 2 3 1 data_421
1 3 3 2 2 3 2 data_422
1 3 3 2 2 4 1 data_423
1 3 3 2 2 4 2 data_424
1 3 3 2 3 1 1 data_425
1 3 3 2 3 1 2 data_426
1 3 3 2 3 2 1 data_427
1 3 3 2 3 2 2 data_428
1 3 3 2 3 3 1 data_429
1 3 3 2 3 3 2 data_430
1 3 3 2 3 4 1 data_431
1 3 3 2 3 4 2 data_432

View File

@ -0,0 +1,124 @@
1 1 1 1 1 3 1 data_5
1 1 1 1 1 3 2 data_6
1 1 1 1 3 2 1 data_19
1 1 1 1 3 3 2 data_22
1 1 1 2 1 2 1 data_27
1 1 1 2 1 2 2 data_28
1 1 1 2 2 3 1 data_37
1 1 1 2 2 4 1 data_39
1 1 1 2 3 1 2 data_42
1 1 2 1 1 1 2 data_50
0 1 2 1 1 2 1 data_51
0 1 2 1 1 3 1 data_53
0 1 2 1 1 4 2 data_56
1 1 2 1 2 1 1 data_57
0 1 2 1 2 3 1 data_61
0 1 2 1 2 3 2 data_62
0 1 2 1 2 4 2 data_64
0 1 2 1 3 2 1 data_67
0 1 2 1 3 4 2 data_72
0 1 2 2 1 2 2 data_76
0 1 2 2 2 3 2 data_86
0 1 2 2 2 4 1 data_87
0 1 2 2 2 4 2 data_88
0 1 2 2 3 2 2 data_92
0 1 2 2 3 3 1 data_93
0 1 2 2 3 3 2 data_94
0 1 3 1 1 2 1 data_99
0 1 3 1 1 4 1 data_103
0 1 3 1 2 2 1 data_107
0 1 3 1 2 4 1 data_111
1 1 3 1 3 1 2 data_114
0 1 3 1 3 2 2 data_116
0 1 3 1 3 3 1 data_117
0 1 3 1 3 4 1 data_119
0 1 3 1 3 4 2 data_120
0 1 3 2 1 2 2 data_124
1 1 3 2 2 1 2 data_130
0 1 3 2 2 2 2 data_132
0 1 3 2 2 3 2 data_134
0 1 3 2 2 4 1 data_135
0 1 3 2 2 4 2 data_136
1 1 3 2 3 1 1 data_137
0 1 3 2 3 2 1 data_139
0 1 3 2 3 4 1 data_143
0 1 3 2 3 4 2 data_144
0 2 1 1 1 3 1 data_149
0 2 1 1 1 3 2 data_150
1 2 1 1 2 1 1 data_153
1 2 1 1 2 1 2 data_154
0 2 1 1 2 2 2 data_156
0 2 1 1 2 3 1 data_157
0 2 1 1 2 4 1 data_159
0 2 1 1 2 4 2 data_160
0 2 1 1 3 4 1 data_167
0 2 1 2 1 2 2 data_172
0 2 1 2 1 3 1 data_173
0 2 1 2 1 4 2 data_176
0 2 1 2 2 3 1 data_181
0 2 1 2 2 4 2 data_184
0 2 1 2 3 2 2 data_188
0 2 1 2 3 4 1 data_191
1 2 2 1 1 2 1 data_195
1 2 2 1 1 2 2 data_196
1 2 2 1 1 3 1 data_197
1 2 2 1 2 3 2 data_206
1 2 2 1 3 1 1 data_209
1 2 2 1 3 1 2 data_210
1 2 2 1 3 2 2 data_212
1 2 2 1 3 3 2 data_214
1 2 2 1 3 4 2 data_216
1 2 2 2 1 1 1 data_217
1 2 2 2 1 3 2 data_222
1 2 2 2 1 4 1 data_223
1 2 2 2 1 4 2 data_224
1 2 2 2 2 2 1 data_227
1 2 2 2 3 4 1 data_239
1 2 3 1 1 1 1 data_241
1 2 3 1 2 1 1 data_249
0 2 3 1 2 3 1 data_253
1 2 3 1 3 1 2 data_258
0 2 3 1 3 3 1 data_261
0 2 3 1 3 4 2 data_264
0 2 3 2 1 3 2 data_270
1 2 3 2 2 1 1 data_273
1 2 3 2 2 1 2 data_274
0 2 3 2 2 2 1 data_275
0 2 3 2 3 3 2 data_286
1 3 1 1 1 1 1 data_289
1 3 1 1 1 1 2 data_290
1 3 1 1 2 1 1 data_297
0 3 1 1 2 2 2 data_300
0 3 1 1 3 2 2 data_308
1 3 1 2 1 1 1 data_313
0 3 1 2 1 2 2 data_316
0 3 1 2 2 2 2 data_324
0 3 1 2 2 3 2 data_326
0 3 1 2 3 2 2 data_332
1 3 2 1 1 1 1 data_337
0 3 2 1 1 4 2 data_344
1 3 2 1 2 1 2 data_346
0 3 2 1 2 4 2 data_352
1 3 2 2 1 1 1 data_361
1 3 2 2 1 1 2 data_362
0 3 2 2 1 3 2 data_366
1 3 2 2 3 1 1 data_377
0 3 2 2 3 2 1 data_379
0 3 2 2 3 4 1 data_383
1 3 3 1 1 1 1 data_385
1 3 3 1 1 2 1 data_387
1 3 3 1 1 4 2 data_392
1 3 3 1 2 3 2 data_398
1 3 3 1 2 4 2 data_400
1 3 3 1 3 1 2 data_402
1 3 3 1 3 2 1 data_403
1 3 3 1 3 2 2 data_404
1 3 3 1 3 4 2 data_408
1 3 3 2 1 1 1 data_409
1 3 3 2 1 3 2 data_414
1 3 3 2 1 4 1 data_415
1 3 3 2 1 4 2 data_416
1 3 3 2 3 1 2 data_426
1 3 3 2 3 2 2 data_428
1 3 3 2 3 3 2 data_430
1 3 3 2 3 4 2 data_432

View File

@ -0,0 +1,432 @@
0 1 1 1 1 1 1 data_1
0 1 1 1 1 1 2 data_2
0 1 1 1 1 2 1 data_3
0 1 1 1 1 2 2 data_4
0 1 1 1 1 3 1 data_5
0 1 1 1 1 3 2 data_6
0 1 1 1 1 4 1 data_7
0 1 1 1 1 4 2 data_8
0 1 1 1 2 1 1 data_9
0 1 1 1 2 1 2 data_10
0 1 1 1 2 2 1 data_11
0 1 1 1 2 2 2 data_12
0 1 1 1 2 3 1 data_13
0 1 1 1 2 3 2 data_14
0 1 1 1 2 4 1 data_15
0 1 1 1 2 4 2 data_16
0 1 1 1 3 1 1 data_17
0 1 1 1 3 1 2 data_18
0 1 1 1 3 2 1 data_19
0 1 1 1 3 2 2 data_20
0 1 1 1 3 3 1 data_21
0 1 1 1 3 3 2 data_22
0 1 1 1 3 4 1 data_23
0 1 1 1 3 4 2 data_24
0 1 1 2 1 1 1 data_25
0 1 1 2 1 1 2 data_26
0 1 1 2 1 2 1 data_27
0 1 1 2 1 2 2 data_28
0 1 1 2 1 3 1 data_29
0 1 1 2 1 3 2 data_30
0 1 1 2 1 4 1 data_31
0 1 1 2 1 4 2 data_32
0 1 1 2 2 1 1 data_33
0 1 1 2 2 1 2 data_34
0 1 1 2 2 2 1 data_35
1 1 1 2 2 2 2 data_36
0 1 1 2 2 3 1 data_37
1 1 1 2 2 3 2 data_38
0 1 1 2 2 4 1 data_39
1 1 1 2 2 4 2 data_40
0 1 1 2 3 1 1 data_41
0 1 1 2 3 1 2 data_42
0 1 1 2 3 2 1 data_43
1 1 1 2 3 2 2 data_44
0 1 1 2 3 3 1 data_45
1 1 1 2 3 3 2 data_46
0 1 1 2 3 4 1 data_47
1 1 1 2 3 4 2 data_48
0 1 2 1 1 1 1 data_49
0 1 2 1 1 1 2 data_50
0 1 2 1 1 2 1 data_51
0 1 2 1 1 2 2 data_52
0 1 2 1 1 3 1 data_53
0 1 2 1 1 3 2 data_54
0 1 2 1 1 4 1 data_55
0 1 2 1 1 4 2 data_56
0 1 2 1 2 1 1 data_57
0 1 2 1 2 1 2 data_58
0 1 2 1 2 2 1 data_59
1 1 2 1 2 2 2 data_60
0 1 2 1 2 3 1 data_61
1 1 2 1 2 3 2 data_62
0 1 2 1 2 4 1 data_63
1 1 2 1 2 4 2 data_64
0 1 2 1 3 1 1 data_65
0 1 2 1 3 1 2 data_66
0 1 2 1 3 2 1 data_67
1 1 2 1 3 2 2 data_68
0 1 2 1 3 3 1 data_69
1 1 2 1 3 3 2 data_70
0 1 2 1 3 4 1 data_71
1 1 2 1 3 4 2 data_72
0 1 2 2 1 1 1 data_73
0 1 2 2 1 1 2 data_74
0 1 2 2 1 2 1 data_75
1 1 2 2 1 2 2 data_76
0 1 2 2 1 3 1 data_77
1 1 2 2 1 3 2 data_78
0 1 2 2 1 4 1 data_79
1 1 2 2 1 4 2 data_80
0 1 2 2 2 1 1 data_81
1 1 2 2 2 1 2 data_82
1 1 2 2 2 2 1 data_83
0 1 2 2 2 2 2 data_84
1 1 2 2 2 3 1 data_85
0 1 2 2 2 3 2 data_86
1 1 2 2 2 4 1 data_87
0 1 2 2 2 4 2 data_88
0 1 2 2 3 1 1 data_89
1 1 2 2 3 1 2 data_90
1 1 2 2 3 2 1 data_91
0 1 2 2 3 2 2 data_92
1 1 2 2 3 3 1 data_93
0 1 2 2 3 3 2 data_94
1 1 2 2 3 4 1 data_95
0 1 2 2 3 4 2 data_96
0 1 3 1 1 1 1 data_97
0 1 3 1 1 1 2 data_98
0 1 3 1 1 2 1 data_99
0 1 3 1 1 2 2 data_100
0 1 3 1 1 3 1 data_101
0 1 3 1 1 3 2 data_102
0 1 3 1 1 4 1 data_103
0 1 3 1 1 4 2 data_104
0 1 3 1 2 1 1 data_105
0 1 3 1 2 1 2 data_106
0 1 3 1 2 2 1 data_107
1 1 3 1 2 2 2 data_108
0 1 3 1 2 3 1 data_109
1 1 3 1 2 3 2 data_110
0 1 3 1 2 4 1 data_111
1 1 3 1 2 4 2 data_112
0 1 3 1 3 1 1 data_113
0 1 3 1 3 1 2 data_114
0 1 3 1 3 2 1 data_115
1 1 3 1 3 2 2 data_116
0 1 3 1 3 3 1 data_117
1 1 3 1 3 3 2 data_118
0 1 3 1 3 4 1 data_119
1 1 3 1 3 4 2 data_120
0 1 3 2 1 1 1 data_121
0 1 3 2 1 1 2 data_122
0 1 3 2 1 2 1 data_123
1 1 3 2 1 2 2 data_124
0 1 3 2 1 3 1 data_125
1 1 3 2 1 3 2 data_126
0 1 3 2 1 4 1 data_127
1 1 3 2 1 4 2 data_128
0 1 3 2 2 1 1 data_129
1 1 3 2 2 1 2 data_130
1 1 3 2 2 2 1 data_131
0 1 3 2 2 2 2 data_132
1 1 3 2 2 3 1 data_133
0 1 3 2 2 3 2 data_134
1 1 3 2 2 4 1 data_135
0 1 3 2 2 4 2 data_136
0 1 3 2 3 1 1 data_137
1 1 3 2 3 1 2 data_138
1 1 3 2 3 2 1 data_139
0 1 3 2 3 2 2 data_140
1 1 3 2 3 3 1 data_141
0 1 3 2 3 3 2 data_142
1 1 3 2 3 4 1 data_143
0 1 3 2 3 4 2 data_144
0 2 1 1 1 1 1 data_145
0 2 1 1 1 1 2 data_146
0 2 1 1 1 2 1 data_147
0 2 1 1 1 2 2 data_148
0 2 1 1 1 3 1 data_149
0 2 1 1 1 3 2 data_150
0 2 1 1 1 4 1 data_151
0 2 1 1 1 4 2 data_152
0 2 1 1 2 1 1 data_153
0 2 1 1 2 1 2 data_154
0 2 1 1 2 2 1 data_155
1 2 1 1 2 2 2 data_156
0 2 1 1 2 3 1 data_157
1 2 1 1 2 3 2 data_158
0 2 1 1 2 4 1 data_159
1 2 1 1 2 4 2 data_160
0 2 1 1 3 1 1 data_161
0 2 1 1 3 1 2 data_162
0 2 1 1 3 2 1 data_163
1 2 1 1 3 2 2 data_164
0 2 1 1 3 3 1 data_165
1 2 1 1 3 3 2 data_166
0 2 1 1 3 4 1 data_167
1 2 1 1 3 4 2 data_168
0 2 1 2 1 1 1 data_169
0 2 1 2 1 1 2 data_170
0 2 1 2 1 2 1 data_171
1 2 1 2 1 2 2 data_172
0 2 1 2 1 3 1 data_173
1 2 1 2 1 3 2 data_174
0 2 1 2 1 4 1 data_175
1 2 1 2 1 4 2 data_176
0 2 1 2 2 1 1 data_177
1 2 1 2 2 1 2 data_178
1 2 1 2 2 2 1 data_179
0 2 1 2 2 2 2 data_180
1 2 1 2 2 3 1 data_181
0 2 1 2 2 3 2 data_182
1 2 1 2 2 4 1 data_183
0 2 1 2 2 4 2 data_184
0 2 1 2 3 1 1 data_185
1 2 1 2 3 1 2 data_186
1 2 1 2 3 2 1 data_187
0 2 1 2 3 2 2 data_188
1 2 1 2 3 3 1 data_189
0 2 1 2 3 3 2 data_190
1 2 1 2 3 4 1 data_191
0 2 1 2 3 4 2 data_192
0 2 2 1 1 1 1 data_193
0 2 2 1 1 1 2 data_194
0 2 2 1 1 2 1 data_195
1 2 2 1 1 2 2 data_196
0 2 2 1 1 3 1 data_197
1 2 2 1 1 3 2 data_198
0 2 2 1 1 4 1 data_199
1 2 2 1 1 4 2 data_200
0 2 2 1 2 1 1 data_201
1 2 2 1 2 1 2 data_202
1 2 2 1 2 2 1 data_203
0 2 2 1 2 2 2 data_204
1 2 2 1 2 3 1 data_205
0 2 2 1 2 3 2 data_206
1 2 2 1 2 4 1 data_207
0 2 2 1 2 4 2 data_208
0 2 2 1 3 1 1 data_209
1 2 2 1 3 1 2 data_210
1 2 2 1 3 2 1 data_211
0 2 2 1 3 2 2 data_212
1 2 2 1 3 3 1 data_213
0 2 2 1 3 3 2 data_214
1 2 2 1 3 4 1 data_215
0 2 2 1 3 4 2 data_216
0 2 2 2 1 1 1 data_217
1 2 2 2 1 1 2 data_218
1 2 2 2 1 2 1 data_219
0 2 2 2 1 2 2 data_220
1 2 2 2 1 3 1 data_221
0 2 2 2 1 3 2 data_222
1 2 2 2 1 4 1 data_223
0 2 2 2 1 4 2 data_224
1 2 2 2 2 1 1 data_225
0 2 2 2 2 1 2 data_226
0 2 2 2 2 2 1 data_227
0 2 2 2 2 2 2 data_228
0 2 2 2 2 3 1 data_229
0 2 2 2 2 3 2 data_230
0 2 2 2 2 4 1 data_231
0 2 2 2 2 4 2 data_232
1 2 2 2 3 1 1 data_233
0 2 2 2 3 1 2 data_234
0 2 2 2 3 2 1 data_235
0 2 2 2 3 2 2 data_236
0 2 2 2 3 3 1 data_237
0 2 2 2 3 3 2 data_238
0 2 2 2 3 4 1 data_239
0 2 2 2 3 4 2 data_240
0 2 3 1 1 1 1 data_241
0 2 3 1 1 1 2 data_242
0 2 3 1 1 2 1 data_243
1 2 3 1 1 2 2 data_244
0 2 3 1 1 3 1 data_245
1 2 3 1 1 3 2 data_246
0 2 3 1 1 4 1 data_247
1 2 3 1 1 4 2 data_248
0 2 3 1 2 1 1 data_249
1 2 3 1 2 1 2 data_250
1 2 3 1 2 2 1 data_251
0 2 3 1 2 2 2 data_252
1 2 3 1 2 3 1 data_253
0 2 3 1 2 3 2 data_254
1 2 3 1 2 4 1 data_255
0 2 3 1 2 4 2 data_256
0 2 3 1 3 1 1 data_257
1 2 3 1 3 1 2 data_258
1 2 3 1 3 2 1 data_259
0 2 3 1 3 2 2 data_260
1 2 3 1 3 3 1 data_261
0 2 3 1 3 3 2 data_262
1 2 3 1 3 4 1 data_263
0 2 3 1 3 4 2 data_264
0 2 3 2 1 1 1 data_265
1 2 3 2 1 1 2 data_266
1 2 3 2 1 2 1 data_267
0 2 3 2 1 2 2 data_268
1 2 3 2 1 3 1 data_269
0 2 3 2 1 3 2 data_270
1 2 3 2 1 4 1 data_271
0 2 3 2 1 4 2 data_272
1 2 3 2 2 1 1 data_273
0 2 3 2 2 1 2 data_274
0 2 3 2 2 2 1 data_275
0 2 3 2 2 2 2 data_276
0 2 3 2 2 3 1 data_277
0 2 3 2 2 3 2 data_278
0 2 3 2 2 4 1 data_279
0 2 3 2 2 4 2 data_280
1 2 3 2 3 1 1 data_281
0 2 3 2 3 1 2 data_282
0 2 3 2 3 2 1 data_283
0 2 3 2 3 2 2 data_284
0 2 3 2 3 3 1 data_285
0 2 3 2 3 3 2 data_286
0 2 3 2 3 4 1 data_287
0 2 3 2 3 4 2 data_288
0 3 1 1 1 1 1 data_289
0 3 1 1 1 1 2 data_290
0 3 1 1 1 2 1 data_291
0 3 1 1 1 2 2 data_292
0 3 1 1 1 3 1 data_293
0 3 1 1 1 3 2 data_294
0 3 1 1 1 4 1 data_295
0 3 1 1 1 4 2 data_296
0 3 1 1 2 1 1 data_297
0 3 1 1 2 1 2 data_298
0 3 1 1 2 2 1 data_299
1 3 1 1 2 2 2 data_300
0 3 1 1 2 3 1 data_301
1 3 1 1 2 3 2 data_302
0 3 1 1 2 4 1 data_303
1 3 1 1 2 4 2 data_304
0 3 1 1 3 1 1 data_305
0 3 1 1 3 1 2 data_306
0 3 1 1 3 2 1 data_307
1 3 1 1 3 2 2 data_308
0 3 1 1 3 3 1 data_309
1 3 1 1 3 3 2 data_310
0 3 1 1 3 4 1 data_311
1 3 1 1 3 4 2 data_312
0 3 1 2 1 1 1 data_313
0 3 1 2 1 1 2 data_314
0 3 1 2 1 2 1 data_315
1 3 1 2 1 2 2 data_316
0 3 1 2 1 3 1 data_317
1 3 1 2 1 3 2 data_318
0 3 1 2 1 4 1 data_319
1 3 1 2 1 4 2 data_320
0 3 1 2 2 1 1 data_321
1 3 1 2 2 1 2 data_322
1 3 1 2 2 2 1 data_323
0 3 1 2 2 2 2 data_324
1 3 1 2 2 3 1 data_325
0 3 1 2 2 3 2 data_326
1 3 1 2 2 4 1 data_327
0 3 1 2 2 4 2 data_328
0 3 1 2 3 1 1 data_329
1 3 1 2 3 1 2 data_330
1 3 1 2 3 2 1 data_331
0 3 1 2 3 2 2 data_332
1 3 1 2 3 3 1 data_333
0 3 1 2 3 3 2 data_334
1 3 1 2 3 4 1 data_335
0 3 1 2 3 4 2 data_336
0 3 2 1 1 1 1 data_337
0 3 2 1 1 1 2 data_338
0 3 2 1 1 2 1 data_339
1 3 2 1 1 2 2 data_340
0 3 2 1 1 3 1 data_341
1 3 2 1 1 3 2 data_342
0 3 2 1 1 4 1 data_343
1 3 2 1 1 4 2 data_344
0 3 2 1 2 1 1 data_345
1 3 2 1 2 1 2 data_346
1 3 2 1 2 2 1 data_347
0 3 2 1 2 2 2 data_348
1 3 2 1 2 3 1 data_349
0 3 2 1 2 3 2 data_350
1 3 2 1 2 4 1 data_351
0 3 2 1 2 4 2 data_352
0 3 2 1 3 1 1 data_353
1 3 2 1 3 1 2 data_354
1 3 2 1 3 2 1 data_355
0 3 2 1 3 2 2 data_356
1 3 2 1 3 3 1 data_357
0 3 2 1 3 3 2 data_358
1 3 2 1 3 4 1 data_359
0 3 2 1 3 4 2 data_360
0 3 2 2 1 1 1 data_361
1 3 2 2 1 1 2 data_362
1 3 2 2 1 2 1 data_363
0 3 2 2 1 2 2 data_364
1 3 2 2 1 3 1 data_365
0 3 2 2 1 3 2 data_366
1 3 2 2 1 4 1 data_367
0 3 2 2 1 4 2 data_368
1 3 2 2 2 1 1 data_369
0 3 2 2 2 1 2 data_370
0 3 2 2 2 2 1 data_371
0 3 2 2 2 2 2 data_372
0 3 2 2 2 3 1 data_373
0 3 2 2 2 3 2 data_374
0 3 2 2 2 4 1 data_375
0 3 2 2 2 4 2 data_376
1 3 2 2 3 1 1 data_377
0 3 2 2 3 1 2 data_378
0 3 2 2 3 2 1 data_379
0 3 2 2 3 2 2 data_380
0 3 2 2 3 3 1 data_381
0 3 2 2 3 3 2 data_382
0 3 2 2 3 4 1 data_383
0 3 2 2 3 4 2 data_384
0 3 3 1 1 1 1 data_385
0 3 3 1 1 1 2 data_386
0 3 3 1 1 2 1 data_387
1 3 3 1 1 2 2 data_388
0 3 3 1 1 3 1 data_389
1 3 3 1 1 3 2 data_390
0 3 3 1 1 4 1 data_391
1 3 3 1 1 4 2 data_392
0 3 3 1 2 1 1 data_393
1 3 3 1 2 1 2 data_394
1 3 3 1 2 2 1 data_395
0 3 3 1 2 2 2 data_396
1 3 3 1 2 3 1 data_397
0 3 3 1 2 3 2 data_398
1 3 3 1 2 4 1 data_399
0 3 3 1 2 4 2 data_400
0 3 3 1 3 1 1 data_401
1 3 3 1 3 1 2 data_402
1 3 3 1 3 2 1 data_403
0 3 3 1 3 2 2 data_404
1 3 3 1 3 3 1 data_405
0 3 3 1 3 3 2 data_406
1 3 3 1 3 4 1 data_407
0 3 3 1 3 4 2 data_408
0 3 3 2 1 1 1 data_409
1 3 3 2 1 1 2 data_410
1 3 3 2 1 2 1 data_411
0 3 3 2 1 2 2 data_412
1 3 3 2 1 3 1 data_413
0 3 3 2 1 3 2 data_414
1 3 3 2 1 4 1 data_415
0 3 3 2 1 4 2 data_416
1 3 3 2 2 1 1 data_417
0 3 3 2 2 1 2 data_418
0 3 3 2 2 2 1 data_419
0 3 3 2 2 2 2 data_420
0 3 3 2 2 3 1 data_421
0 3 3 2 2 3 2 data_422
0 3 3 2 2 4 1 data_423
0 3 3 2 2 4 2 data_424
1 3 3 2 3 1 1 data_425
0 3 3 2 3 1 2 data_426
0 3 3 2 3 2 1 data_427
0 3 3 2 3 2 2 data_428
0 3 3 2 3 3 1 data_429
0 3 3 2 3 3 2 data_430
0 3 3 2 3 4 1 data_431
0 3 3 2 3 4 2 data_432

View File

@ -0,0 +1,169 @@
0 1 1 1 1 2 2 data_4
0 1 1 1 1 4 1 data_7
0 1 1 1 2 1 1 data_9
0 1 1 1 2 1 2 data_10
0 1 1 1 2 2 1 data_11
0 1 1 1 2 3 1 data_13
0 1 1 1 2 4 1 data_15
0 1 1 1 3 2 1 data_19
0 1 1 1 3 4 1 data_23
0 1 1 2 1 1 1 data_25
0 1 1 2 1 1 2 data_26
0 1 1 2 2 3 1 data_37
0 1 1 2 2 4 1 data_39
1 1 1 2 2 4 2 data_40
0 1 1 2 3 1 2 data_42
1 1 1 2 3 2 2 data_44
0 1 2 1 1 1 2 data_50
0 1 2 1 2 1 2 data_58
1 1 2 1 2 2 2 data_60
0 1 2 1 2 3 1 data_61
1 1 2 1 2 3 2 data_62
0 1 2 1 2 4 1 data_63
0 1 2 1 3 1 1 data_65
0 1 2 1 3 1 2 data_66
1 1 2 1 3 2 2 data_68
0 1 2 1 3 3 1 data_69
1 1 2 1 3 3 2 data_70
0 1 2 1 3 4 1 data_71
1 1 2 1 3 4 2 data_72
0 1 2 2 1 2 1 data_75
0 1 2 2 1 4 1 data_79
1 1 2 2 2 3 1 data_85
1 1 2 2 2 4 1 data_87
0 1 2 2 3 1 1 data_89
1 1 2 2 3 1 2 data_90
1 1 2 2 3 3 1 data_93
0 1 2 2 3 3 2 data_94
1 1 2 2 3 4 1 data_95
0 1 2 2 3 4 2 data_96
0 1 3 1 1 1 2 data_98
0 1 3 1 1 2 2 data_100
0 1 3 1 1 3 1 data_101
0 1 3 1 1 3 2 data_102
0 1 3 1 2 2 1 data_107
1 1 3 1 2 2 2 data_108
1 1 3 1 2 3 2 data_110
0 1 3 1 2 4 1 data_111
1 1 3 1 3 2 2 data_116
0 1 3 1 3 3 1 data_117
1 1 3 1 3 4 2 data_120
0 1 3 2 1 3 1 data_125
1 1 3 2 1 3 2 data_126
0 1 3 2 1 4 1 data_127
1 1 3 2 2 1 2 data_130
0 1 3 2 2 3 2 data_134
0 1 3 2 2 4 2 data_136
1 1 3 2 3 2 1 data_139
0 2 1 1 1 1 1 data_145
0 2 1 1 1 2 2 data_148
0 2 1 1 1 3 1 data_149
1 2 1 1 2 2 2 data_156
0 2 1 1 3 1 2 data_162
1 2 1 1 3 2 2 data_164
1 2 1 1 3 3 2 data_166
0 2 1 1 3 4 1 data_167
0 2 1 2 1 1 1 data_169
1 2 1 2 1 2 2 data_172
0 2 1 2 1 4 1 data_175
1 2 1 2 2 2 1 data_179
0 2 1 2 2 4 2 data_184
0 2 1 2 3 1 1 data_185
1 2 1 2 3 1 2 data_186
0 2 1 2 3 2 2 data_188
0 2 1 2 3 3 2 data_190
0 2 1 2 3 4 2 data_192
0 2 2 1 1 3 1 data_197
1 2 2 1 1 4 2 data_200
0 2 2 1 2 1 1 data_201
1 2 2 1 2 3 1 data_205
1 2 2 1 3 3 1 data_213
0 2 2 1 3 3 2 data_214
1 2 2 1 3 4 1 data_215
0 2 2 2 1 1 1 data_217
0 2 2 2 1 2 2 data_220
0 2 2 2 1 3 2 data_222
1 2 2 2 1 4 1 data_223
0 2 2 2 1 4 2 data_224
1 2 2 2 2 1 1 data_225
0 2 2 2 2 2 2 data_228
0 2 2 2 2 3 1 data_229
1 2 2 2 3 1 1 data_233
0 2 2 2 3 2 1 data_235
0 2 2 2 3 2 2 data_236
0 2 2 2 3 4 2 data_240
0 2 3 1 1 1 1 data_241
0 2 3 1 1 1 2 data_242
1 2 3 1 1 3 2 data_246
0 2 3 1 2 1 1 data_249
1 2 3 1 2 3 1 data_253
0 2 3 1 2 3 2 data_254
0 2 3 1 2 4 2 data_256
1 2 3 1 3 1 2 data_258
1 2 3 1 3 2 1 data_259
1 2 3 1 3 4 1 data_263
1 2 3 2 1 1 2 data_266
1 2 3 2 1 2 1 data_267
1 2 3 2 1 3 1 data_269
0 2 3 2 1 4 2 data_272
1 2 3 2 2 1 1 data_273
0 2 3 2 2 2 1 data_275
0 2 3 2 2 3 2 data_278
0 2 3 2 3 3 1 data_285
0 2 3 2 3 3 2 data_286
0 2 3 2 3 4 2 data_288
0 3 1 1 1 4 1 data_295
0 3 1 1 2 1 2 data_298
1 3 1 1 2 2 2 data_300
1 3 1 1 2 3 2 data_302
0 3 1 1 2 4 1 data_303
1 3 1 1 2 4 2 data_304
0 3 1 1 3 1 1 data_305
0 3 1 1 3 1 2 data_306
1 3 1 1 3 2 2 data_308
1 3 1 1 3 3 2 data_310
0 3 1 2 1 1 1 data_313
1 3 1 2 1 2 2 data_316
0 3 1 2 1 3 1 data_317
1 3 1 2 1 3 2 data_318
0 3 1 2 1 4 1 data_319
1 3 1 2 1 4 2 data_320
1 3 1 2 2 2 1 data_323
1 3 1 2 3 1 2 data_330
1 3 1 2 3 2 1 data_331
0 3 1 2 3 2 2 data_332
0 3 1 2 3 4 2 data_336
0 3 2 1 1 1 2 data_338
1 3 2 1 1 2 2 data_340
0 3 2 1 1 3 1 data_341
1 3 2 1 1 3 2 data_342
1 3 2 1 2 1 2 data_346
1 3 2 1 2 2 1 data_347
0 3 2 1 3 1 1 data_353
1 3 2 1 3 2 1 data_355
1 3 2 1 3 3 1 data_357
0 3 2 1 3 3 2 data_358
0 3 2 2 1 1 1 data_361
0 3 2 2 1 2 2 data_364
1 3 2 2 1 3 1 data_365
0 3 2 2 1 3 2 data_366
1 3 2 2 2 1 1 data_369
0 3 2 2 2 2 1 data_371
0 3 2 2 2 2 2 data_372
0 3 2 2 2 3 2 data_374
1 3 2 2 3 1 1 data_377
0 3 2 2 3 3 2 data_382
0 3 2 2 3 4 2 data_384
0 3 3 1 1 1 1 data_385
0 3 3 1 1 2 1 data_387
0 3 3 1 1 3 1 data_389
1 3 3 1 1 3 2 data_390
0 3 3 1 2 3 2 data_398
0 3 3 2 1 1 1 data_409
1 3 3 2 2 1 1 data_417
0 3 3 2 2 2 1 data_419
0 3 3 2 2 3 1 data_421
0 3 3 2 2 3 2 data_422
1 3 3 2 3 1 1 data_425
0 3 3 2 3 2 1 data_427
0 3 3 2 3 4 2 data_432

View File

@ -0,0 +1,432 @@
1 1 1 1 1 1 1 data_1
1 1 1 1 1 1 2 data_2
1 1 1 1 1 2 1 data_3
1 1 1 1 1 2 2 data_4
1 1 1 1 1 3 1 data_5
1 1 1 1 1 3 2 data_6
0 1 1 1 1 4 1 data_7
0 1 1 1 1 4 2 data_8
1 1 1 1 2 1 1 data_9
1 1 1 1 2 1 2 data_10
1 1 1 1 2 2 1 data_11
1 1 1 1 2 2 2 data_12
1 1 1 1 2 3 1 data_13
1 1 1 1 2 3 2 data_14
0 1 1 1 2 4 1 data_15
0 1 1 1 2 4 2 data_16
1 1 1 1 3 1 1 data_17
1 1 1 1 3 1 2 data_18
1 1 1 1 3 2 1 data_19
1 1 1 1 3 2 2 data_20
1 1 1 1 3 3 1 data_21
1 1 1 1 3 3 2 data_22
0 1 1 1 3 4 1 data_23
0 1 1 1 3 4 2 data_24
1 1 1 2 1 1 1 data_25
1 1 1 2 1 1 2 data_26
1 1 1 2 1 2 1 data_27
1 1 1 2 1 2 2 data_28
1 1 1 2 1 3 1 data_29
1 1 1 2 1 3 2 data_30
0 1 1 2 1 4 1 data_31
0 1 1 2 1 4 2 data_32
1 1 1 2 2 1 1 data_33
1 1 1 2 2 1 2 data_34
1 1 1 2 2 2 1 data_35
1 1 1 2 2 2 2 data_36
1 1 1 2 2 3 1 data_37
1 1 1 2 2 3 2 data_38
0 1 1 2 2 4 1 data_39
0 1 1 2 2 4 2 data_40
1 1 1 2 3 1 1 data_41
1 1 1 2 3 1 2 data_42
1 1 1 2 3 2 1 data_43
1 1 1 2 3 2 2 data_44
1 1 1 2 3 3 1 data_45
1 1 1 2 3 3 2 data_46
0 1 1 2 3 4 1 data_47
0 1 1 2 3 4 2 data_48
1 1 2 1 1 1 1 data_49
1 1 2 1 1 1 2 data_50
1 1 2 1 1 2 1 data_51
1 1 2 1 1 2 2 data_52
1 1 2 1 1 3 1 data_53
1 1 2 1 1 3 2 data_54
0 1 2 1 1 4 1 data_55
0 1 2 1 1 4 2 data_56
1 1 2 1 2 1 1 data_57
1 1 2 1 2 1 2 data_58
1 1 2 1 2 2 1 data_59
1 1 2 1 2 2 2 data_60
1 1 2 1 2 3 1 data_61
1 1 2 1 2 3 2 data_62
0 1 2 1 2 4 1 data_63
0 1 2 1 2 4 2 data_64
1 1 2 1 3 1 1 data_65
1 1 2 1 3 1 2 data_66
1 1 2 1 3 2 1 data_67
1 1 2 1 3 2 2 data_68
1 1 2 1 3 3 1 data_69
1 1 2 1 3 3 2 data_70
0 1 2 1 3 4 1 data_71
0 1 2 1 3 4 2 data_72
1 1 2 2 1 1 1 data_73
1 1 2 2 1 1 2 data_74
1 1 2 2 1 2 1 data_75
1 1 2 2 1 2 2 data_76
1 1 2 2 1 3 1 data_77
1 1 2 2 1 3 2 data_78
0 1 2 2 1 4 1 data_79
0 1 2 2 1 4 2 data_80
1 1 2 2 2 1 1 data_81
1 1 2 2 2 1 2 data_82
1 1 2 2 2 2 1 data_83
1 1 2 2 2 2 2 data_84
1 1 2 2 2 3 1 data_85
1 1 2 2 2 3 2 data_86
0 1 2 2 2 4 1 data_87
0 1 2 2 2 4 2 data_88
1 1 2 2 3 1 1 data_89
1 1 2 2 3 1 2 data_90
1 1 2 2 3 2 1 data_91
1 1 2 2 3 2 2 data_92
1 1 2 2 3 3 1 data_93
1 1 2 2 3 3 2 data_94
0 1 2 2 3 4 1 data_95
0 1 2 2 3 4 2 data_96
0 1 3 1 1 1 1 data_97
0 1 3 1 1 1 2 data_98
0 1 3 1 1 2 1 data_99
0 1 3 1 1 2 2 data_100
1 1 3 1 1 3 1 data_101
1 1 3 1 1 3 2 data_102
0 1 3 1 1 4 1 data_103
0 1 3 1 1 4 2 data_104
0 1 3 1 2 1 1 data_105
0 1 3 1 2 1 2 data_106
0 1 3 1 2 2 1 data_107
0 1 3 1 2 2 2 data_108
0 1 3 1 2 3 1 data_109
0 1 3 1 2 3 2 data_110
0 1 3 1 2 4 1 data_111
0 1 3 1 2 4 2 data_112
0 1 3 1 3 1 1 data_113
0 1 3 1 3 1 2 data_114
0 1 3 1 3 2 1 data_115
0 1 3 1 3 2 2 data_116
0 1 3 1 3 3 1 data_117
0 1 3 1 3 3 2 data_118
0 1 3 1 3 4 1 data_119
0 1 3 1 3 4 2 data_120
0 1 3 2 1 1 1 data_121
0 1 3 2 1 1 2 data_122
0 1 3 2 1 2 1 data_123
0 1 3 2 1 2 2 data_124
1 1 3 2 1 3 1 data_125
1 1 3 2 1 3 2 data_126
0 1 3 2 1 4 1 data_127
0 1 3 2 1 4 2 data_128
0 1 3 2 2 1 1 data_129
0 1 3 2 2 1 2 data_130
0 1 3 2 2 2 1 data_131
0 1 3 2 2 2 2 data_132
0 1 3 2 2 3 1 data_133
0 1 3 2 2 3 2 data_134
0 1 3 2 2 4 1 data_135
0 1 3 2 2 4 2 data_136
0 1 3 2 3 1 1 data_137
0 1 3 2 3 1 2 data_138
0 1 3 2 3 2 1 data_139
0 1 3 2 3 2 2 data_140
0 1 3 2 3 3 1 data_141
0 1 3 2 3 3 2 data_142
0 1 3 2 3 4 1 data_143
0 1 3 2 3 4 2 data_144
1 2 1 1 1 1 1 data_145
1 2 1 1 1 1 2 data_146
1 2 1 1 1 2 1 data_147
1 2 1 1 1 2 2 data_148
1 2 1 1 1 3 1 data_149
1 2 1 1 1 3 2 data_150
0 2 1 1 1 4 1 data_151
0 2 1 1 1 4 2 data_152
1 2 1 1 2 1 1 data_153
1 2 1 1 2 1 2 data_154
1 2 1 1 2 2 1 data_155
1 2 1 1 2 2 2 data_156
1 2 1 1 2 3 1 data_157
1 2 1 1 2 3 2 data_158
0 2 1 1 2 4 1 data_159
0 2 1 1 2 4 2 data_160
1 2 1 1 3 1 1 data_161
1 2 1 1 3 1 2 data_162
1 2 1 1 3 2 1 data_163
1 2 1 1 3 2 2 data_164
1 2 1 1 3 3 1 data_165
1 2 1 1 3 3 2 data_166
0 2 1 1 3 4 1 data_167
0 2 1 1 3 4 2 data_168
1 2 1 2 1 1 1 data_169
1 2 1 2 1 1 2 data_170
1 2 1 2 1 2 1 data_171
1 2 1 2 1 2 2 data_172
1 2 1 2 1 3 1 data_173
1 2 1 2 1 3 2 data_174
0 2 1 2 1 4 1 data_175
0 2 1 2 1 4 2 data_176
1 2 1 2 2 1 1 data_177
1 2 1 2 2 1 2 data_178
1 2 1 2 2 2 1 data_179
1 2 1 2 2 2 2 data_180
1 2 1 2 2 3 1 data_181
1 2 1 2 2 3 2 data_182
0 2 1 2 2 4 1 data_183
0 2 1 2 2 4 2 data_184
1 2 1 2 3 1 1 data_185
1 2 1 2 3 1 2 data_186
1 2 1 2 3 2 1 data_187
1 2 1 2 3 2 2 data_188
1 2 1 2 3 3 1 data_189
1 2 1 2 3 3 2 data_190
0 2 1 2 3 4 1 data_191
0 2 1 2 3 4 2 data_192
1 2 2 1 1 1 1 data_193
1 2 2 1 1 1 2 data_194
1 2 2 1 1 2 1 data_195
1 2 2 1 1 2 2 data_196
1 2 2 1 1 3 1 data_197
1 2 2 1 1 3 2 data_198
0 2 2 1 1 4 1 data_199
0 2 2 1 1 4 2 data_200
1 2 2 1 2 1 1 data_201
1 2 2 1 2 1 2 data_202
1 2 2 1 2 2 1 data_203
1 2 2 1 2 2 2 data_204
1 2 2 1 2 3 1 data_205
1 2 2 1 2 3 2 data_206
0 2 2 1 2 4 1 data_207
0 2 2 1 2 4 2 data_208
1 2 2 1 3 1 1 data_209
1 2 2 1 3 1 2 data_210
1 2 2 1 3 2 1 data_211
1 2 2 1 3 2 2 data_212
1 2 2 1 3 3 1 data_213
1 2 2 1 3 3 2 data_214
0 2 2 1 3 4 1 data_215
0 2 2 1 3 4 2 data_216
1 2 2 2 1 1 1 data_217
1 2 2 2 1 1 2 data_218
1 2 2 2 1 2 1 data_219
1 2 2 2 1 2 2 data_220
1 2 2 2 1 3 1 data_221
1 2 2 2 1 3 2 data_222
0 2 2 2 1 4 1 data_223
0 2 2 2 1 4 2 data_224
1 2 2 2 2 1 1 data_225
1 2 2 2 2 1 2 data_226
1 2 2 2 2 2 1 data_227
1 2 2 2 2 2 2 data_228
1 2 2 2 2 3 1 data_229
1 2 2 2 2 3 2 data_230
0 2 2 2 2 4 1 data_231
0 2 2 2 2 4 2 data_232
1 2 2 2 3 1 1 data_233
1 2 2 2 3 1 2 data_234
1 2 2 2 3 2 1 data_235
1 2 2 2 3 2 2 data_236
1 2 2 2 3 3 1 data_237
1 2 2 2 3 3 2 data_238
0 2 2 2 3 4 1 data_239
0 2 2 2 3 4 2 data_240
0 2 3 1 1 1 1 data_241
0 2 3 1 1 1 2 data_242
0 2 3 1 1 2 1 data_243
0 2 3 1 1 2 2 data_244
1 2 3 1 1 3 1 data_245
1 2 3 1 1 3 2 data_246
0 2 3 1 1 4 1 data_247
0 2 3 1 1 4 2 data_248
0 2 3 1 2 1 1 data_249
0 2 3 1 2 1 2 data_250
0 2 3 1 2 2 1 data_251
0 2 3 1 2 2 2 data_252
0 2 3 1 2 3 1 data_253
0 2 3 1 2 3 2 data_254
0 2 3 1 2 4 1 data_255
0 2 3 1 2 4 2 data_256
0 2 3 1 3 1 1 data_257
0 2 3 1 3 1 2 data_258
0 2 3 1 3 2 1 data_259
0 2 3 1 3 2 2 data_260
0 2 3 1 3 3 1 data_261
0 2 3 1 3 3 2 data_262
0 2 3 1 3 4 1 data_263
0 2 3 1 3 4 2 data_264
0 2 3 2 1 1 1 data_265
0 2 3 2 1 1 2 data_266
0 2 3 2 1 2 1 data_267
0 2 3 2 1 2 2 data_268
1 2 3 2 1 3 1 data_269
1 2 3 2 1 3 2 data_270
0 2 3 2 1 4 1 data_271
0 2 3 2 1 4 2 data_272
0 2 3 2 2 1 1 data_273
0 2 3 2 2 1 2 data_274
0 2 3 2 2 2 1 data_275
0 2 3 2 2 2 2 data_276
0 2 3 2 2 3 1 data_277
0 2 3 2 2 3 2 data_278
0 2 3 2 2 4 1 data_279
0 2 3 2 2 4 2 data_280
0 2 3 2 3 1 1 data_281
0 2 3 2 3 1 2 data_282
0 2 3 2 3 2 1 data_283
0 2 3 2 3 2 2 data_284
0 2 3 2 3 3 1 data_285
0 2 3 2 3 3 2 data_286
0 2 3 2 3 4 1 data_287
0 2 3 2 3 4 2 data_288
1 3 1 1 1 1 1 data_289
1 3 1 1 1 1 2 data_290
1 3 1 1 1 2 1 data_291
1 3 1 1 1 2 2 data_292
1 3 1 1 1 3 1 data_293
1 3 1 1 1 3 2 data_294
0 3 1 1 1 4 1 data_295
0 3 1 1 1 4 2 data_296
1 3 1 1 2 1 1 data_297
1 3 1 1 2 1 2 data_298
1 3 1 1 2 2 1 data_299
1 3 1 1 2 2 2 data_300
1 3 1 1 2 3 1 data_301
1 3 1 1 2 3 2 data_302
0 3 1 1 2 4 1 data_303
0 3 1 1 2 4 2 data_304
1 3 1 1 3 1 1 data_305
1 3 1 1 3 1 2 data_306
1 3 1 1 3 2 1 data_307
1 3 1 1 3 2 2 data_308
1 3 1 1 3 3 1 data_309
1 3 1 1 3 3 2 data_310
0 3 1 1 3 4 1 data_311
0 3 1 1 3 4 2 data_312
1 3 1 2 1 1 1 data_313
1 3 1 2 1 1 2 data_314
1 3 1 2 1 2 1 data_315
1 3 1 2 1 2 2 data_316
1 3 1 2 1 3 1 data_317
1 3 1 2 1 3 2 data_318
0 3 1 2 1 4 1 data_319
0 3 1 2 1 4 2 data_320
1 3 1 2 2 1 1 data_321
1 3 1 2 2 1 2 data_322
1 3 1 2 2 2 1 data_323
1 3 1 2 2 2 2 data_324
1 3 1 2 2 3 1 data_325
1 3 1 2 2 3 2 data_326
0 3 1 2 2 4 1 data_327
0 3 1 2 2 4 2 data_328
1 3 1 2 3 1 1 data_329
1 3 1 2 3 1 2 data_330
1 3 1 2 3 2 1 data_331
1 3 1 2 3 2 2 data_332
1 3 1 2 3 3 1 data_333
1 3 1 2 3 3 2 data_334
0 3 1 2 3 4 1 data_335
0 3 1 2 3 4 2 data_336
1 3 2 1 1 1 1 data_337
1 3 2 1 1 1 2 data_338
1 3 2 1 1 2 1 data_339
1 3 2 1 1 2 2 data_340
1 3 2 1 1 3 1 data_341
1 3 2 1 1 3 2 data_342
0 3 2 1 1 4 1 data_343
0 3 2 1 1 4 2 data_344
1 3 2 1 2 1 1 data_345
1 3 2 1 2 1 2 data_346
1 3 2 1 2 2 1 data_347
1 3 2 1 2 2 2 data_348
1 3 2 1 2 3 1 data_349
1 3 2 1 2 3 2 data_350
0 3 2 1 2 4 1 data_351
0 3 2 1 2 4 2 data_352
1 3 2 1 3 1 1 data_353
1 3 2 1 3 1 2 data_354
1 3 2 1 3 2 1 data_355
1 3 2 1 3 2 2 data_356
1 3 2 1 3 3 1 data_357
1 3 2 1 3 3 2 data_358
0 3 2 1 3 4 1 data_359
0 3 2 1 3 4 2 data_360
1 3 2 2 1 1 1 data_361
1 3 2 2 1 1 2 data_362
1 3 2 2 1 2 1 data_363
1 3 2 2 1 2 2 data_364
1 3 2 2 1 3 1 data_365
1 3 2 2 1 3 2 data_366
0 3 2 2 1 4 1 data_367
0 3 2 2 1 4 2 data_368
1 3 2 2 2 1 1 data_369
1 3 2 2 2 1 2 data_370
1 3 2 2 2 2 1 data_371
1 3 2 2 2 2 2 data_372
1 3 2 2 2 3 1 data_373
1 3 2 2 2 3 2 data_374
0 3 2 2 2 4 1 data_375
0 3 2 2 2 4 2 data_376
1 3 2 2 3 1 1 data_377
1 3 2 2 3 1 2 data_378
1 3 2 2 3 2 1 data_379
1 3 2 2 3 2 2 data_380
1 3 2 2 3 3 1 data_381
1 3 2 2 3 3 2 data_382
0 3 2 2 3 4 1 data_383
0 3 2 2 3 4 2 data_384
0 3 3 1 1 1 1 data_385
0 3 3 1 1 1 2 data_386
0 3 3 1 1 2 1 data_387
0 3 3 1 1 2 2 data_388
1 3 3 1 1 3 1 data_389
1 3 3 1 1 3 2 data_390
0 3 3 1 1 4 1 data_391
0 3 3 1 1 4 2 data_392
0 3 3 1 2 1 1 data_393
0 3 3 1 2 1 2 data_394
0 3 3 1 2 2 1 data_395
0 3 3 1 2 2 2 data_396
0 3 3 1 2 3 1 data_397
0 3 3 1 2 3 2 data_398
0 3 3 1 2 4 1 data_399
0 3 3 1 2 4 2 data_400
0 3 3 1 3 1 1 data_401
0 3 3 1 3 1 2 data_402
0 3 3 1 3 2 1 data_403
0 3 3 1 3 2 2 data_404
0 3 3 1 3 3 1 data_405
0 3 3 1 3 3 2 data_406
0 3 3 1 3 4 1 data_407
0 3 3 1 3 4 2 data_408
0 3 3 2 1 1 1 data_409
0 3 3 2 1 1 2 data_410
0 3 3 2 1 2 1 data_411
0 3 3 2 1 2 2 data_412
1 3 3 2 1 3 1 data_413
1 3 3 2 1 3 2 data_414
0 3 3 2 1 4 1 data_415
0 3 3 2 1 4 2 data_416
0 3 3 2 2 1 1 data_417
0 3 3 2 2 1 2 data_418
0 3 3 2 2 2 1 data_419
0 3 3 2 2 2 2 data_420
0 3 3 2 2 3 1 data_421
0 3 3 2 2 3 2 data_422
0 3 3 2 2 4 1 data_423
0 3 3 2 2 4 2 data_424
0 3 3 2 3 1 1 data_425
0 3 3 2 3 1 2 data_426
0 3 3 2 3 2 1 data_427
0 3 3 2 3 2 2 data_428
0 3 3 2 3 3 1 data_429
0 3 3 2 3 3 2 data_430
0 3 3 2 3 4 1 data_431
0 3 3 2 3 4 2 data_432

View File

@ -0,0 +1,122 @@
1 1 1 1 1 1 2 data_2
1 1 1 1 1 2 1 data_3
1 1 1 1 1 2 2 data_4
0 1 1 1 1 3 1 data_5
0 1 1 1 1 4 1 data_7
1 1 1 1 2 1 1 data_9
1 1 1 1 2 2 2 data_12
0 1 1 1 2 4 2 data_16
1 1 1 2 1 2 2 data_28
0 1 1 2 1 4 2 data_32
1 1 1 2 2 2 2 data_36
0 1 1 2 2 4 1 data_39
0 1 1 2 2 4 2 data_40
1 1 1 2 3 1 1 data_41
1 1 1 2 3 1 2 data_42
1 1 1 2 3 3 1 data_45
1 1 1 2 3 3 2 data_46
1 1 2 1 1 3 1 data_53
1 1 2 1 2 2 1 data_59
1 1 2 1 2 2 2 data_60
0 1 2 1 2 3 1 data_61
1 1 2 1 3 1 1 data_65
1 1 2 1 3 1 2 data_66
1 1 2 1 3 2 1 data_67
1 1 2 1 3 2 2 data_68
1 1 2 1 3 3 2 data_70
0 1 2 1 3 4 1 data_71
1 1 2 2 1 3 1 data_77
0 1 2 2 1 4 2 data_80
1 1 2 2 2 1 1 data_81
1 1 2 2 2 2 1 data_83
1 1 2 2 2 2 2 data_84
1 1 2 2 3 1 1 data_89
1 1 2 2 3 2 1 data_91
1 1 2 2 3 2 2 data_92
0 1 3 1 1 2 1 data_99
0 1 3 1 1 4 1 data_103
0 1 3 1 2 3 2 data_110
0 1 3 1 2 4 1 data_111
0 1 3 1 3 1 1 data_113
0 1 3 1 3 3 1 data_117
0 1 3 2 1 1 1 data_121
0 1 3 2 1 1 2 data_122
0 1 3 2 1 2 1 data_123
0 1 3 2 1 4 2 data_128
0 1 3 2 2 3 2 data_134
0 1 3 2 2 4 2 data_136
0 1 3 2 3 4 1 data_143
1 2 1 1 1 1 1 data_145
1 2 1 1 1 1 2 data_146
0 2 1 1 1 4 1 data_151
0 2 1 1 1 4 2 data_152
1 2 1 1 2 1 1 data_153
1 2 1 1 2 1 2 data_154
1 2 1 1 3 2 2 data_164
1 2 1 1 3 3 2 data_166
0 2 1 1 3 4 1 data_167
1 2 1 2 1 2 2 data_172
0 2 1 2 2 4 1 data_183
1 2 1 2 3 1 2 data_186
1 2 2 1 1 3 2 data_198
0 2 2 1 1 4 2 data_200
1 2 2 1 2 1 2 data_202
0 2 2 1 2 2 1 data_203
1 2 2 1 3 1 1 data_209
1 2 2 1 3 2 2 data_212
0 2 2 1 3 3 1 data_213
0 2 2 1 3 3 2 data_214
0 2 2 1 3 4 2 data_216
1 2 2 2 1 2 2 data_220
1 2 2 2 2 1 2 data_226
1 2 2 2 2 3 1 data_229
1 2 2 2 2 3 2 data_230
0 2 2 2 3 4 1 data_239
1 2 3 1 1 3 1 data_245
0 2 3 1 2 1 1 data_249
0 2 3 1 2 2 1 data_251
0 2 3 1 2 2 2 data_252
0 2 3 1 2 3 2 data_254
0 2 3 1 3 3 1 data_261
0 2 3 2 1 1 2 data_266
0 2 3 2 1 2 2 data_268
0 2 3 2 1 4 1 data_271
0 2 3 2 2 3 1 data_277
0 2 3 2 2 4 2 data_280
0 2 3 2 3 1 1 data_281
0 2 3 2 3 2 1 data_283
0 2 3 2 3 4 2 data_288
1 3 1 1 1 1 1 data_289
1 3 1 1 1 2 1 data_291
1 3 1 1 1 3 1 data_293
0 3 1 1 2 4 2 data_304
1 3 1 1 3 1 2 data_306
0 3 1 1 3 4 2 data_312
1 3 1 2 1 2 1 data_315
1 3 1 2 2 3 2 data_326
0 3 1 2 2 4 2 data_328
1 3 1 2 3 1 1 data_329
1 3 2 1 1 2 2 data_340
0 3 2 1 1 4 1 data_343
1 3 2 1 2 3 1 data_349
1 3 2 1 3 1 2 data_354
1 3 2 2 1 2 2 data_364
1 3 2 2 1 3 2 data_366
1 3 2 2 2 1 2 data_370
1 3 2 2 3 1 1 data_377
1 3 2 2 3 3 2 data_382
0 3 2 2 3 4 1 data_383
1 3 3 1 1 3 2 data_390
1 3 3 1 1 4 1 data_391
0 3 3 1 2 4 2 data_400
0 3 3 1 3 1 1 data_401
0 3 3 1 3 2 1 data_403
0 3 3 1 3 2 2 data_404
0 3 3 1 3 4 1 data_407
0 3 3 2 1 1 1 data_409
0 3 3 2 1 1 2 data_410
0 3 3 2 2 2 2 data_420
0 3 3 2 2 3 2 data_422
0 3 3 2 3 1 1 data_425
0 3 3 2 3 3 2 data_430
0 3 3 2 3 4 2 data_432

View File

@ -0,0 +1,76 @@
1. Title: The Monk's Problems
2. Sources:
(a) Donor: Sebastian Thrun
School of Computer Science
Carnegie Mellon University
Pittsburgh, PA 15213, USA
E-mail: thrun@cs.cmu.edu
(b) Date: October 1992
3. Past Usage:
- See File: thrun.comparison.ps.Z
- Wnek, J., "Hypothesis-driven Constructive Induction," PhD dissertation,
School of Information Technology and Engineering, Reports of Machine
Learning and Inference Laboratory, MLI 93-2, Center for Artificial
Intelligence, George Mason University, March 1993.
- Wnek, J. and Michalski, R.S., "Comparing Symbolic and
Subsymbolic Learning: Three Studies," in Machine Learning: A
Multistrategy Approach, Vol. 4., R.S. Michalski and G. Tecuci (Eds.),
Morgan Kaufmann, San Mateo, CA, 1993.
4. Relevant Information:
The MONK's problem were the basis of a first international comparison
of learning algorithms. The result of this comparison is summarized in
"The MONK's Problems - A Performance Comparison of Different Learning
algorithms" by S.B. Thrun, J. Bala, E. Bloedorn, I. Bratko, B.
Cestnik, J. Cheng, K. De Jong, S. Dzeroski, S.E. Fahlman, D. Fisher,
R. Hamann, K. Kaufman, S. Keller, I. Kononenko, J. Kreuziger, R.S.
Michalski, T. Mitchell, P. Pachowicz, Y. Reich H. Vafaie, W. Van de
Welde, W. Wenzel, J. Wnek, and J. Zhang has been published as
Technical Report CS-CMU-91-197, Carnegie Mellon University in Dec.
1991.
One significant characteristic of this comparison is that it was
performed by a collection of researchers, each of whom was an advocate
of the technique they tested (often they were the creators of the
various methods). In this sense, the results are less biased than in
comparisons performed by a single person advocating a specific
learning method, and more accurately reflect the generalization
behavior of the learning techniques as applied by knowledgeable users.
There are three MONK's problems. The domains for all MONK's problems
are the same (described below). One of the MONK's problems has noise
added. For each problem, the domain has been partitioned into a train
and test set.
5. Number of Instances: 432
6. Number of Attributes: 8 (including class attribute)
7. Attribute information:
1. class: 0, 1
2. a1: 1, 2, 3
3. a2: 1, 2, 3
4. a3: 1, 2
5. a4: 1, 2, 3
6. a5: 1, 2, 3, 4
7. a6: 1, 2
8. Id: (A unique symbol for each instance)
8. Missing Attribute Values: None
9. Target Concepts associated to the MONK's problem:
MONK-1: (a1 = a2) or (a5 = 1)
MONK-2: EXACTLY TWO of {a1 = 1, a2 = 1, a3 = 1, a4 = 1, a5 = 1, a6 = 1}
MONK-3: (a5 = 3 and a4 = 1) or (a5 /= 4 and a2 /= 3)
(5% class noise added to the training set)

View File

@ -0,0 +1,16 @@
! Copyright (C) 2018 Björn Lindqvist
! See http://factorcode.org/license.txt for BSD license
USING: kernel machine-learning.data-sets
machine-learning.decision-trees math.extras sequences tools.test ;
IN: machine-learning.decision-trees.tests
{ { 0.08 0.01 0.0 0.03 0.29 0.0 } } [
"monks-1.train" load-monks
6 <iota> [
average-gain 2 round-to-decimal
] with map
] unit-test
{ 4 } [
"monks-1.train" load-monks highest-gain-index
] unit-test

View File

@ -0,0 +1,33 @@
! Copyright (C) 2018 Björn Lindqvist
! See http://factorcode.org/license.txt for BSD license
USING: accessors assocs fry grouping.extras kernel locals math
math.functions math.statistics sequences sequences.extras sorting ;
IN: machine-learning.decision-trees
! Why convert the logarithm to base 2? I don't know.
: entropy2 ( seq -- e )
normalized-histogram values entropy 2 log / ;
: group-by-sorted ( seq quot: ( elt -- key ) -- groups )
[ sort-with ] keep group-by ; inline
: subsets-weighted-entropy ( data-target idx -- seq )
! Group the data according to the given index.
'[ first _ swap nth ] group-by-sorted
! Then unpack the partitioned groups of targets
'[ [ second ] map ] assoc-map values
! Finally, calculate the weighted entropy for each group
[ [ entropy2 ] [ length ] bi * ] map-sum ; inline
:: average-gain ( dataset idx -- gain )
dataset target>> :> target
dataset data>> :> data
data target zip :> data-target
data-target idx subsets-weighted-entropy :> weighted
target entropy2 weighted data length / - ;
: highest-gain-index ( dataset -- idx )
dup feature-names>> length <iota> [
average-gain
] with map arg-max ;

View File

@ -1,8 +1,8 @@
! Copyright (C) 2010 Erik Charlebois.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors kernel locals math math.order math.polynomials
math.splines opengl.gl sequences ui.gadgets ui.gadgets.panes ui.render
arrays ;
math.splines opengl.demo-support opengl.gl sequences ui.gadgets
ui.gadgets.panes ui.render arrays ;
IN: math.splines.viewer
<PRIVATE
@ -33,11 +33,11 @@ M:: spline-gadget draw-gadget* ( gadget -- )
[ second y-min - y-max y-min - / gadget spline-dim>> second * ] bi 2array
] map :> pts
GL_LINE_STRIP glBegin
pts [
first2 neg gadget spline-dim>> second + glVertex2f
] each
glEnd ;
GL_LINE_STRIP [
pts [
first2 neg gadget spline-dim>> second + glVertex2f
] each ]
do-state ;
:: <spline-gadget> ( polynomials dim steps -- gadget )
spline-gadget new

View File

@ -1,7 +1,7 @@
! From http://www.ffconsultancy.com/ocaml/maze/index.html
USING: accessors arrays fry kernel math math.order math.vectors
namespaces opengl.gl random sequences ui ui.gadgets
ui.gadgets.canvas ui.render ;
namespaces opengl.demo-support opengl.gl random sequences ui
ui.gadgets ui.gadgets.canvas ui.render ;
IN: maze
CONSTANT: line-width 8
@ -25,7 +25,7 @@ SYMBOL: visited
: (draw-maze) ( cell -- )
dup vertex
glEnd
GL_POINTS glBegin dup vertex glEnd
GL_POINTS [ dup vertex ] do-state
GL_LINE_STRIP glBegin
dup vertex
dup visit
@ -42,9 +42,9 @@ SYMBOL: visited
line-width 2 - glPointSize
1.0 1.0 1.0 1.0 glColor4d
dup '[ _ t <array> ] replicate visited set
GL_LINE_STRIP glBegin
{ 0 0 } dup vertex (draw-maze)
glEnd ;
GL_LINE_STRIP [
{ 0 0 } dup vertex (draw-maze)
] do-state ;
TUPLE: maze < canvas ;

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@ -0,0 +1 @@
John Benediktsson

View File

@ -0,0 +1,299 @@
! Copyright (C) 2017 John Benediktsson
! See http://factorcode.org/license.txt for BSD license
USING: accessors arrays assocs calendar colors.constants
combinators combinators.short-circuit destructors formatting fry
images.loader kernel locals math math.order math.parser
namespaces opengl opengl.textures random sequences timers ui
ui.commands ui.gadgets ui.gadgets.toolbar ui.gadgets.tracks
ui.gadgets.worlds ui.gestures ui.pens.solid ui.render words ;
IN: minesweeper
CONSTANT: neighbors {
{ -1 -1 } { -1 0 } { -1 1 }
{ 0 -1 } { 0 1 }
{ 1 -1 } { 1 0 } { 1 1 }
}
SYMBOLS: +flagged+ +question+ +clicked+ ;
TUPLE: cell #adjacent mined? state ;
: make-cells ( rows cols -- cells )
'[ _ [ cell new ] replicate ] replicate ;
:: cell-at ( cells row col -- cell/f )
row cells ?nth [ col swap ?nth ] [ f ] if* ;
: cells-dim ( cells -- rows cols )
[ length ] [ first length ] bi ;
: unmined-cell ( cells -- cell )
f [ dup mined?>> ] [ drop dup random random ] do while nip ;
: #mines ( cells -- n )
[ [ mined?>> ] count ] map-sum ;
: #flagged ( cells -- n )
[ [ state>> +flagged+ = ] count ] map-sum ;
: #mines-remaining ( cells -- n )
[ #mines ] [ #flagged ] bi - ;
: place-mines ( cells n -- cells )
[ dup unmined-cell t >>mined? drop ] times ;
: adjacent-mines ( cells row col -- #mines )
neighbors [
first2 [ + ] bi-curry@ bi* cell-at
[ mined?>> ] [ f ] if*
] with with with count ;
:: each-cell ( ... cells quot: ( ... row col cell -- ... ) -- ... )
cells [| row |
[| cell col | row col cell quot call ] each-index
] each-index ; inline
:: update-counts ( cells -- cells )
cells [| row col cell |
cells row col adjacent-mines cell #adjacent<<
] each-cell cells ;
: reset-cells ( cells -- cells )
[ cells-dim make-cells ] [ #mines place-mines ] bi update-counts ;
: won? ( cells -- ? )
[ [ { [ state>> +clicked+ = ] [ mined?>> ] } 1|| ] all? ] all? ;
: lost? ( cells -- ? )
[ [ { [ state>> +clicked+ = ] [ mined?>> ] } 1&& ] any? ] any? ;
: game-over? ( cells -- ? )
{ [ lost? ] [ won? ] } 1|| ;
: new-game? ( cells -- ? )
[ [ state>> +clicked+ = ] any? ] any? not ;
DEFER: click-cell-at
:: click-cells-around ( cells row col -- )
neighbors [
first2 [ row + ] [ col + ] bi* :> ( row' col' )
cells row' col' cell-at [
{ [ mined?>> ] [ state>> +question+ = ] } 1|| [
cells row' col' click-cell-at drop
] unless
] when*
] each ;
:: click-cell-at ( cells row col -- ? )
cells row col cell-at [
cells new-game? [
! first click shouldn't be a mine
dup mined?>> [
cells unmined-cell t >>mined? drop f >>mined?
cells update-counts drop
] when
] when
dup state>> { +clicked+ +flagged+ } member? [ drop f ] [
+clicked+ >>state
{ [ mined?>> not ] [ #adjacent>> 0 = ] } 1&& [
cells row col click-cells-around
] when t
] if
] [ f ] if* ;
:: mark-cell-at ( cells row col -- ? )
cells row col cell-at [
dup state>> {
{ +clicked+ [ +clicked+ ] }
{ +flagged+ [ +question+ ] }
{ +question+ [ f ] }
{ f [ +flagged+ ] }
} case >>state drop t
] [ f ] if* ;
TUPLE: grid-gadget < gadget cells timer textures start end ;
:: <grid-gadget> ( rows cols mines -- gadget )
grid-gadget new
rows cols make-cells
mines place-mines update-counts >>cells
H{ } clone >>textures
dup '[ _ relayout-1 ] f 1 seconds <timer> >>timer
COLOR: gray <solid> >>interior ;
M: grid-gadget graft*
[ timer>> start-timer ] [ call-next-method ] bi ;
M: grid-gadget ungraft*
[
dup find-gl-context
[ values dispose-each H{ } clone ] change-textures
timer>> stop-timer
] [ call-next-method ] bi ;
M: grid-gadget pref-dim*
cells>> cells-dim [ 32 * ] bi@ swap 58 + 2array ;
:: cell-image-path ( cell game-over? -- image-path )
game-over? cell mined?>> and [
cell state>> +clicked+ = "mineclicked.gif" "mine.gif" ?
] [
cell state>>
{
{ +question+ [ "question.gif" ] }
{ +flagged+ [ game-over? "misflagged.gif" "flagged.gif" ? ] }
{ +clicked+ [
cell mined?>> [
"mine.gif"
] [
cell #adjacent>> 0 or number>string
"open" ".gif" surround
] if ] }
{ f [ "blank.gif" ] }
} case
] if "vocab:minesweeper/_resources/" prepend ;
: digit-image-path ( ch -- image-path )
"vocab:minesweeper/_resources/digit%c.gif" sprintf ;
:: smiley-image-path ( won? lost? clicking? -- image-path )
{
{ [ lost? ] [ "vocab:minesweeper/_resources/smileylost.gif" ] }
{ [ won? ] [ "vocab:minesweeper/_resources/smileywon.gif" ] }
{ [ clicking? ] [ "vocab:minesweeper/_resources/smileyuhoh.gif" ] }
[ "vocab:minesweeper/_resources/smiley.gif" ]
} cond ;
: cached-texture ( path gadget -- texture )
textures>> [ load-image { 0 0 } <texture> ] cache ;
:: draw-mines ( n gadget -- )
n "%03d" sprintf [
26 * 3 + 6 2array [
digit-image-path gadget cached-texture
{ 26 46 } swap draw-scaled-texture
] with-translation
] each-index ;
:: draw-smiley ( gadget -- )
gadget pref-dim first :> width
width 2/ 26 - 3 2array [
gadget cells>> won?
gadget cells>> lost?
hand-buttons get-global empty? not
gadget hand-click-rel second 58 >= and
smiley-image-path
gadget cached-texture { 52 52 } swap draw-scaled-texture
] with-translation ;
:: draw-timer ( n gadget -- )
gadget pref-dim first :> width
n "%03d" sprintf [
3 swap - 26 * width swap - 3 - 6 2array [
digit-image-path gadget cached-texture
{ 26 46 } swap draw-scaled-texture
] with-translation
] each-index ;
:: draw-cells ( gadget -- )
gadget cells>> game-over? :> game-over?
gadget cells>> [| row col cell |
col row [ 32 * ] bi@ 58 + 2array [
cell game-over? cell-image-path
gadget cached-texture
{ 32 32 } swap draw-scaled-texture
] with-translation
] each-cell ;
:: elapsed-time ( gadget -- n )
gadget start>> [
gadget end>> now or swap time- duration>seconds
] [ 0 ] if* ;
M: grid-gadget draw-gadget*
{
[ cells>> #mines-remaining ]
[ draw-mines ]
[ draw-smiley ]
[ elapsed-time ]
[ draw-timer ]
[ draw-cells ]
} cleave ;
:: on-click ( gadget -- )
gadget hand-rel first2 :> ( w h )
h 58 < [
h 3 55 between?
gadget pref-dim first 2/ w - abs 26 < and [
gadget [ reset-cells ] change-cells
f >>start f >>end relayout-1
] when
] [
h 58 - w [ 32 /i ] bi@ :> ( row col )
gadget cells>> :> cells
cells game-over? [
cells row col click-cell-at [
gadget start>> [ now gadget start<< ] unless
cells game-over? [ now gadget end<< ] when
gadget relayout-1
] when
] unless
] if ;
:: on-mark ( gadget -- )
gadget hand-rel first2 :> ( w h )
h 58 >= [
h 58 - w [ 32 /i ] bi@ :> ( row col )
gadget cells>> :> cells
cells game-over? [
cells row col mark-cell-at [
gadget start>> [ now gadget start<< ] unless
cells game-over? [ now gadget end<< ] when
gadget relayout-1
] when
] unless
] when ;
: new-game ( gadget rows cols mines -- )
[ make-cells ] dip place-mines update-counts >>cells
f >>start f >>end relayout-window ;
: com-easy ( gadget -- ) 7 7 10 new-game ;
: com-medium ( gadget -- ) 15 15 40 new-game ;
: com-hard ( gadget -- ) 15 30 99 new-game ;
grid-gadget "toolbar" f {
{ T{ key-down { sym "1" } } com-easy }
{ T{ key-down { sym "2" } } com-medium }
{ T{ key-down { sym "3" } } com-hard }
} define-command-map
grid-gadget "gestures" [
{
{ T{ button-down { # 1 } } [ relayout-1 ] }
{ T{ button-up { # 1 } } [ on-click ] }
{ T{ button-up { # 3 } } [ on-mark ] }
{ T{ key-down { sym " " } } [ on-mark ] }
} assoc-union
] change-word-prop
TUPLE: minesweeper-gadget < track ;
: <minesweeper-gadget> ( -- gadget )
vertical minesweeper-gadget new-track
7 7 10 <grid-gadget>
[ <toolbar> format-toolbar f track-add ]
[ 1 track-add ] bi ;
M: minesweeper-gadget focusable-child* children>> second ;
MAIN-WINDOW: run-minesweeper {
{ title "Minesweeper" }
{ window-controls
{ normal-title-bar close-button minimize-button } }
} <minesweeper-gadget> >>gadgets ;

View File

@ -0,0 +1 @@
_resources

View File

@ -0,0 +1 @@
Minesweeper game

View File

@ -0,0 +1 @@
demos

View File

@ -0,0 +1,24 @@
! Copyright (C) 2018 Björn Lindqvist.
! See http://factorcode.org/license.txt for BSD license.
USING: help.markup help.syntax ;
IN: oauth2
ARTICLE: "oauth2" "Oauth2 Support"
"The " { $vocab-link "oauth2" } " vocab implements client support for the Oauth2 protocol."
$nl
"To use the oauth2 vocab, first create an instance of the " { $link oauth2 } " class to represent the Oauth2 provider's settings. The slots 'auth-uri' and 'token-uri' should be set to the providers authentication and token uri:ss. The 'redirect-uri' should hold the URI to a callback URL, which usually must be registered with the provider. The 'client-id' and 'client-secret' slots identifies the application and should be kept secret. For example, to initialize an oauth2 instance compatible with GitHub's api use:"
{ $unchecked-example
"\"https://github.com/login/oauth/authorize\""
"\"https://github.com/login/oauth/access_token\""
"\"https://localhost:8080\" \"client-id\" \"client-secret\""
"\"user\" { } oauth2 boa"
}
"Then to get hold of an access token, use the " { $link console-flow } " word and enter the verification code given by the provider. This puts a " { $link tokens } " instance on the stack whose slot 'access' contains the actual access token. It can be used to make API calls on behalf of the user. For example, to list all the user's GitHub repositories:"
{ $unchecked-example
"\"https://api.github.com/user/repos\" \"access-token\""
"oauth-http-get"
}
"Some providers limit the validity of the access token. If so, the provider sets the 'expiry' slot on the " { $link tokens } " tuple to the tokens expiration date and 'refresh' to a refresh token. The refresh token can be used with the " { $link refresh-flow } " word to request new access tokens from the provider."
{ $notes "The vocab only implements the console flow, but other methods for acquiring tokens could be added in the future" } ;
ABOUT: "oauth2"

View File

@ -0,0 +1,8 @@
USING: help.markup help.syntax opengl.gl quotations ;
IN: opengl.demo-support
HELP: do-state
{ $values
{ "mode" GLenum }
{ "quot" quotation }
} { $description "Runs the quotation wrapped in a " { $link glBegin } "/" { $link glEnd } " block." } ;

View File

@ -1,10 +1,8 @@
USING: alien.c-types alien.data arrays colors.constants grouping
kernel locals math math.vectors namespaces opengl opengl.gl
opengl.glu sequences sequences.generalizations shuffle ;
kernel locals math math.vectors namespaces opengl opengl.demo-support
opengl.gl opengl.glu sequences sequences.generalizations shuffle ;
IN: processing.shapes
: do-state ( mode quot -- ) swap glBegin call glEnd ; inline
SYMBOL: fill-color
SYMBOL: stroke-color

View File

@ -1,7 +1,7 @@
! Copyright (c) 2008 Aaron Schaefer.
! See http://factorcode.org/license.txt for BSD license.
USING: arrays kernel math math.ranges
namespaces project-euler.common sequences ;
USING: arrays kernel math math.ranges namespaces project-euler.common
sequences sequences.extras ;
IN: project-euler.039
! http://projecteuler.net/index.php?section=problems&id=39
@ -56,7 +56,7 @@ PRIVATE>
: euler039 ( -- answer )
[
1000 count-perimeters p-count get [ supremum ] keep index
1000 count-perimeters p-count get arg-max
] with-scope ;
! [ euler039 ] 100 ave-time

View File

@ -1,7 +1,7 @@
! Copyright (c) 2009 Aaron Schaefer.
! See http://factorcode.org/license.txt for BSD license.
USING: combinators fry kernel math math.primes math.primes.factors math.ranges
project-euler.common sequences ;
USING: combinators fry kernel math math.primes math.primes.factors
math.ranges project-euler.common sequences sequences.extras ;
IN: project-euler.069
! http://projecteuler.net/index.php?section=problems&id=69
@ -47,7 +47,7 @@ PRIVATE>
: euler069 ( -- answer )
2 1000000 [a,b] [ totient-ratio ] map
[ supremum ] keep index 2 + ;
arg-max 2 + ;
! [ euler069 ] 10 ave-time
! 25210 ms ave run time - 115.37 SD (10 trials)

View File

@ -1,8 +1,9 @@
! Copyright (c) 2010 Aaron Schaefer. All rights reserved.
! The contents of this file are licensed under the Simplified BSD License
! A copy of the license is available at http://factorcode.org/license.txt
USING: arrays assocs combinators.short-circuit kernel math math.combinatorics
math.functions math.primes math.ranges project-euler.common sequences ;
USING: arrays combinators.short-circuit kernel math math.combinatorics
math.functions math.primes project-euler.common sequences
sequences.extras ;
FROM: project-euler.common => permutations? ;
IN: project-euler.070
@ -54,7 +55,7 @@ IN: project-euler.070
first2 { [ drop 7 10^ < ] [ permutations? ] } 2&& ;
: minimum-ratio ( seq -- n )
[ [ first2 / ] map [ infimum ] keep index ] keep nth first ;
[ [ first2 / ] map arg-min ] keep nth first ;
PRIVATE>

View File

@ -1,7 +1,8 @@
! Copyright (c) 2008 Aaron Schaefer.
! See http://factorcode.org/license.txt for BSD license.
USING: io.encodings.ascii io.files kernel math math.functions math.parser
math.vectors sequences splitting project-euler.common ;
USING: io.encodings.ascii io.files kernel math math.functions
math.parser math.vectors project-euler.common sequences
sequences.extras splitting ;
IN: project-euler.099
! http://projecteuler.net/index.php?section=problems&id=99
@ -39,7 +40,7 @@ IN: project-euler.099
flip first2 swap [ log ] map v* ;
: solve ( seq -- index )
simplify [ supremum ] keep index 1 + ;
simplify arg-max 1 + ;
PRIVATE>

View File

@ -230,6 +230,16 @@ HELP: start-all*
"{ 0 2 }"
} } ;
HELP: arg-max
{ $values { "seq" sequence } { "n" integer } }
{ $description "Outputs the sequence with the largest item." } ;
HELP: arg-min
{ $values { "seq" sequence } { "n" integer } }
{ $description "Outputs the sequence with the smallest item." } ;
{ arg-max arg-min } related-words
HELP: count-subseq
{ $values
{ "subseq" sequence } { "seq" sequence } { "n" integer } }

View File

@ -157,6 +157,7 @@ IN: sequences.extras.tests
{ { 1 3 5 } } [ 6 <iota> <odds> >array ] unit-test
{ 1 } [ { 1 7 3 7 6 3 7 } arg-max ] unit-test
{ 2 } [ { 0 1 99 } arg-max ] unit-test
{ 0 } [ { 1 7 3 7 6 3 7 } arg-min ] unit-test
{ V{ 0 4 } } [ { 5 3 2 10 5 } [ 5 = ] arg-where ] unit-test
{ { 2 1 0 4 3 } } [ { 5 3 2 10 5 } arg-sort ] unit-test

View File

@ -411,10 +411,10 @@ INSTANCE: odds immutable-sequence
[ dup empty? ] swap until drop ; inline
: arg-max ( seq -- n )
<enumerated> [ second-unsafe ] supremum-by first ;
[ supremum ] keep index ;
: arg-min ( seq -- n )
<enumerated> [ second-unsafe ] infimum-by first ;
[ infimum ] keep index ;
<PRIVATE

Some files were not shown because too many files have changed in this diff Show More