Commit e4fa567c authored by Dave Cooper's avatar Dave Cooper
Browse files

merged some files.

parent 1f63adfa
(asdf:defsystem #:ta2 :description
"The Gendl™ (legacy) Testing and Tracking Utility, version 2 (using Ajax but pre-gdlAjax, and no JQuery or CSS)"
:author "Dave Cooper and Genworks International" :license
"Gnu Affero General Public License (please see http://www.gnu.org/licenses/)"
:serial t :version "20130324" :depends-on (:gwl-graphics)
#+asdf-encoding :encoding #+asdf-encoding :utf-8
:components
((:file "source/package") (:file "source/parameters")
(:file "source/javascript") (:file "source/action-object")
(:file "source/ajax") (:file "source/assembly")
(:file "source/click-mode") (:file "source/inspector")
(:file "source/object-tree") (:file "source/part-type-form")
(:file "source/publish") (:file "source/viewport")))
(asdf:defsystem #:ta2 :description
"The Gendl (legacy) Testing and Tracking Utility, version 2 (using Ajax but pre-gdlAjax, and no JQuery or CSS)"
:author "John McCarthy" :license
"Affero Gnu Public License (http://www.gnu.org/licenses/)" :serial t
:version "20130402" :depends-on (:gwl-graphics)
#+asdf-encoding :encoding #+asdf-encoding :utf-8
:components
((:file "source/package") (:file "source/parameters")
(:file "source/javascript") (:file "source/action-object")
(:file "source/ajax") (:file "source/assembly")
(:file "source/click-mode") (:file "source/inspector")
(:file "source/object-tree") (:file "source/part-type-form")
(:file "source/publish") (:file "source/viewport")))
(asdf:defsystem #:tasty :description
"The Gendl™ Web-based Development Environment (tasty)" :author
"Dave Cooper and Genworks International" :license
"Gnu Affero General Public License (please see http://www.gnu.org/licenses/)"
:serial t :version "20130324" :depends-on (:tree :gwl-graphics)
#+asdf-encoding :encoding #+asdf-encoding :utf-8
:components
((:file "source/package") (:file "source/parameters")
(:file "source/assembly") (:file "source/initialize")
(:file "source/inspector") (:file "source/menu")
(:file "source/new-inspector") (:file "source/newer-inspector")
(:file "source/part-type-form") (:file "source/publish")
(:file "source/status-object") (:file "source/test-part")
(:file "source/test-part2") (:file "source/two-viewports")
(:file "source/viewport") (:file "source/zzinit")))
(asdf:defsystem #:tasty :description
"The Gendl Web-based Development Environment (tasty)" :author
"John McCarthy" :license
"Affero Gnu Public License (http://www.gnu.org/licenses/)" :serial t
:version "20130402" :depends-on (:tree :gwl-graphics)
#+asdf-encoding :encoding #+asdf-encoding :utf-8
:components
((:file "source/package") (:file "source/parameters")
(:file "source/assembly") (:file "source/initialize")
(:file "source/inspector") (:file "source/menu")
(:file "source/new-inspector") (:file "source/newer-inspector")
(:file "source/part-type-form") (:file "source/publish")
(:file "source/status-object") (:file "source/test-part")
(:file "source/test-part2") (:file "source/two-viewports")
(:file "source/viewport") (:file "source/zzinit")))
(asdf:defsystem #:translators :description
"The Gendl Translators to/from XML and potentially other high-level KBE and Knowledge formats"
:author "Dave Cooper and Genworks International" :license
"Gnu Affero General Public License (please see http://www.gnu.org/licenses/)"
:serial t :version "20130324" :depends-on nil
#+asdf-encoding :encoding #+asdf-encoding :utf-8
:components
((:file "xml/source/package") (:file "xml/source/genworks")
(:file "xml/source/definition-tree") (:file "xml/source/gdl2xml")
(:file "xml/source/xml2gdl")))
(asdf:defsystem #:translators :description
"The Gendl Translators to/from XML and potentially other high-level KBE and Knowledge formats"
:author "John McCarthy" :license
"Affero Gnu Public License (http://www.gnu.org/licenses/)" :serial t
:version "20130402" :depends-on nil
#+asdf-encoding :encoding #+asdf-encoding :utf-8
:components
((:file "xml/source/package") (:file "xml/source/genworks")
(:file "xml/source/definition-tree") (:file "xml/source/gdl2xml")
(:file "xml/source/xml2gdl")))
(asdf:defsystem #:tree :description
"The Gendl Tree component used by Tasty and potentially as a UI component on its own"
:author "Dave Cooper and Genworks International" :license
"Gnu Affero General Public License (please see http://www.gnu.org/licenses/)"
:serial t :version "20130324" :depends-on (:gwl-graphics)
#+asdf-encoding :encoding #+asdf-encoding :utf-8
:components
((:file "source/package") (:file "source/parameters")
(:file "source/ajax") (:file "source/assembly")
(:file "source/newertree")))
(asdf:defsystem #:tree :description
"The Gendl Tree component used by Tasty and potentially as a UI component on its own"
:author "John McCarthy" :license
"Affero Gnu Public License (http://www.gnu.org/licenses/)" :serial t
:version "20130402" :depends-on (:gwl-graphics)
#+asdf-encoding :encoding #+asdf-encoding :utf-8
:components
((:file "source/package") (:file "source/parameters")
(:file "source/ajax") (:file "source/assembly")
(:file "source/newertree")))
(asdf:defsystem #:yadd :description
"The Gendl™ Yet Another Definition Documenter (yadd)" :author
"Dave Cooper and Genworks International" :license
"Gnu Affero General Public License (please see http://www.gnu.org/licenses/)"
:serial t :version "20130324" :depends-on (:gwl-graphics)
#+asdf-encoding :encoding #+asdf-encoding :utf-8
:components
((:file "source/package") (:file "source/genworks")
(:file "source/mixins")
(:file "source/define-object-documentation")
(:file "source/assembly") (:file "source/ass")
(:file "source/format-documentation")
(:file "source/function-documentation") (:file "source/initialize")
(:file "source/parameters") (:file "source/publish")
(:file "source/test-part") (:file "source/variable-documentation")
(:file "source/zzinit")))
(asdf:defsystem #:yadd :description
"The Gendl Yet Another Definition Documenter (yadd)" :author
"John McCarthy" :license
"Affero Gnu Public License (http://www.gnu.org/licenses/)" :serial t
:version "20130402" :depends-on (:gwl-graphics)
#+asdf-encoding :encoding #+asdf-encoding :utf-8
:components
((:file "source/package") (:file "source/genworks")
(:file "source/mixins")
(:file "source/define-object-documentation")
(:file "source/assembly") (:file "source/ass")
(:file "source/format-documentation")
(:file "source/function-documentation") (:file "source/initialize")
(:file "source/parameters") (:file "source/publish")
(:file "source/test-part") (:file "source/variable-documentation")
(:file "source/zzinit")))
(asdf:defsystem #:base :description
"The Gendl™ Base Core Kernel Engine" :author
"Dave Cooper and Genworks International" :license
"Gnu Affero General Public License (please see http://www.gnu.org/licenses/)"
:serial t :version "20130324" :depends-on nil
#+asdf-encoding :encoding #+asdf-encoding :utf-8
:components
((:file "source/package") (:file "source/genworks")
(:file "source/presets") (:file "source/parameters")
(:file "source/metaclasses") (:file "source/utilities")
(:file "source/start") (:file "expanders/source/inputs")
(:file "expanders/source/computed-slots")
(:file "expanders/source/functions")
(:file "expanders/source/methods")
(:file "expanders/source/objects")
(:file "macros/source/reference")
(:file "macros/source/message-utils")
(:file "macros/source/define-object")
(:file "macros/source/defaulting")
(:file "macros/source/define-format")
(:file "rest/source/parameters")
(:file "rest/source/quantification")
(:file "rest/source/aggregate") (:file "rest/source/utilities")
(:file "rest/source/vanilla-mixin")
(:file "rest/source/base-rule-object") (:file "rest/source/bodies")
(:file "rest/source/ignore-errors-with-backtrace")
(:file "rest/source/init") (:file "rest/source/make-part")
(:file "rest/source/null-part") (:file "rest/source/sequence")
(:file "zzinit/source/initialize") (:file "zzinit/source/zzinit")))
(asdf:defsystem #:base :description
"The Gendl™ Base Core Kernel Engine" :author "John McCarthy"
:license "Affero Gnu Public License (http://www.gnu.org/licenses/)"
:serial t :version "20130402" :depends-on nil
#+asdf-encoding :encoding #+asdf-encoding :utf-8
:components
((:file "source/package") (:file "source/genworks")
(:file "source/presets") (:file "source/parameters")
(:file "source/metaclasses") (:file "source/utilities")
(:file "source/start") (:file "expanders/source/inputs")
(:file "expanders/source/computed-slots")
(:file "expanders/source/functions")
(:file "expanders/source/methods")
(:file "expanders/source/objects")
(:file "macros/source/reference")
(:file "macros/source/message-utils")
(:file "macros/source/define-object")
(:file "macros/source/defaulting")
(:file "macros/source/define-format")
(:file "rest/source/parameters")
(:file "rest/source/quantification")
(:file "rest/source/aggregate") (:file "rest/source/utilities")
(:file "rest/source/vanilla-mixin")
(:file "rest/source/base-rule-object") (:file "rest/source/bodies")
(:file "rest/source/ignore-errors-with-backtrace")
(:file "rest/source/init") (:file "rest/source/make-part")
(:file "rest/source/null-part") (:file "rest/source/sequence")
(:file "zzinit/source/initialize") (:file "zzinit/source/zzinit")))
......@@ -257,10 +257,10 @@
args))
#-(or allegro lispworks sbcl ccl)
#-(or allegro lispworks sbcl ccl clisp)
(error "Need implementation for package-documentation for the currently running Lisp.~%")
(defun package-documentation (package)
#+(or allegro lispworks ccl) (documentation (find-package package) t)
#+(or allegro lispworks ccl clisp) (documentation (find-package package) t)
#+sbcl (sb-kernel:package-doc-string (find-package package)))
......
(asdf:defsystem #:cl-lite :description
"The Gendl™ Compile-and-Load Lite Utility" :author
"Dave Cooper and Genworks International" :license
"Gnu Affero General Public License (please see http://www.gnu.org/licenses/)"
:serial t :version "20130324" :depends-on (:glisp)
#+asdf-encoding :encoding #+asdf-encoding :utf-8
:components
((:file "source/package") (:file "source/parameters")
(:file "source/cl-lite") (:file "source/initialize")
(:file "source/zzinit")))
(asdf:defsystem #:cl-lite :description
"The Gendl Compile-and-Load Lite Utility" :author "John McCarthy"
:license "Affero Gnu Public License (http://www.gnu.org/licenses/)"
:serial t :version "20130402" :depends-on (:glisp)
#+asdf-encoding :encoding #+asdf-encoding :utf-8
:components
((:file "source/package") (:file "source/parameters")
(:file "source/cl-lite") (:file "source/initialize")
(:file "source/zzinit")))
......@@ -513,10 +513,10 @@ Defaults to nil (i.e. we assume we are loading into a clean system and need all
;;
;;
(ignore-list (glisp:sexpr-from-file (make-pathname
:directory (pathname-directory (the :pathname))
:device (the :device)
:name "ignore-list"
:type "isc")))
:directory (pathname-directory (the :pathname))
:device (the :device)
:name "ignore-list"
:type "isc")))
(relevant-files (let (key)
(mapcar #'(lambda (thing)
......
(asdf:defsystem #:bus :description
"The Gendl™ Wireframe School Bus Demo" :author
"Dave Cooper and Genworks International" :license
"Gnu Affero General Public License (please see http://www.gnu.org/licenses/)"
:serial t :version "20130324" :depends-on nil
#+asdf-encoding :encoding #+asdf-encoding :utf-8
:components
((:file "source/package") (:file "source/assembly")
(:file "source/body") (:file "source/chassis")
(:file "source/interior") (:file "source/rule-ackermann")
(:file "source/axle") (:file "source/fleet")
(:file "source/frame-rail") (:file "source/frame")
(:file "source/html-writer-assembly")
(:file "source/html-writer-body")
(:file "source/html-writer-chassis")
(:file "source/html-writer-interior")
(:file "source/html-writer-rule-ackermann")
(:file "source/inter-seat-clearance-check")
(:file "source/inter-seat-spacing") (:file "source/knuckle")
(:file "source/parameters") (:file "source/publish")
(:file "source/rear-axle") (:file "source/seat")
(:file "source/seating-section") (:file "source/seating-side")
(:file "source/wheel")))
(asdf:defsystem #:bus :description
"The Gendl™ Wireframe School Bus Demo" :author "John McCarthy"
:license "Affero Gnu Public License (http://www.gnu.org/licenses/)"
:serial t :version "20130402" :depends-on nil
#+asdf-encoding :encoding #+asdf-encoding :utf-8
:components
((:file "source/package") (:file "source/assembly")
(:file "source/body") (:file "source/chassis")
(:file "source/interior") (:file "source/rule-ackermann")
(:file "source/axle") (:file "source/fleet")
(:file "source/frame-rail") (:file "source/frame")
(:file "source/html-writer-assembly")
(:file "source/html-writer-body")
(:file "source/html-writer-chassis")
(:file "source/html-writer-interior")
(:file "source/html-writer-rule-ackermann")
(:file "source/inter-seat-clearance-check")
(:file "source/inter-seat-spacing") (:file "source/knuckle")
(:file "source/parameters") (:file "source/publish")
(:file "source/rear-axle") (:file "source/seat")
(:file "source/seating-section") (:file "source/seating-side")
(:file "source/wheel")))
(asdf:defsystem #:ledger :description
"The Gendl™ Ledger Bookkeeping Demo" :author
"Dave Cooper and Genworks International" :license
"Gnu Affero General Public License (please see http://www.gnu.org/licenses/)"
:serial t :version "20130324" :depends-on nil
#+asdf-encoding :encoding #+asdf-encoding :utf-8
:components
((:file "source/package") (:file "source/assembly")
(:file "source/html")))
(asdf:defsystem #:ledger :description
"The Gendl Ledger Bookkeeping Demo" :author "John McCarthy"
:license "Affero Gnu Public License (http://www.gnu.org/licenses/)"
:serial t :version "20130402" :depends-on nil
#+asdf-encoding :encoding #+asdf-encoding :utf-8
:components
((:file "source/package") (:file "source/assembly")
(:file "source/html")))
(asdf:defsystem #:robot :description
"The Gendl Simplified Android Robot example " :author
"Dave Cooper and Genworks International" :license
"Gnu Affero General Public License (please see http://www.gnu.org/licenses/)"
:serial t :version "20130324" :depends-on (:gwl-graphics)
#+asdf-encoding :encoding #+asdf-encoding :utf-8
:components
((:file "source/package") (:file "source/assembly")
(:file "source/initialize") (:file "source/parameters")
(:file "source/zzinit")))
(asdf:defsystem #:robot :description
"The Gendl Simplified Android Robot example " :author
"John McCarthy" :license
"Affero Gnu Public License (http://www.gnu.org/licenses/)" :serial t
:version "20130402" :depends-on (:gwl-graphics)
#+asdf-encoding :encoding #+asdf-encoding :utf-8
:components
((:file "source/package") (:file "source/assembly")
(:file "source/initialize") (:file "source/parameters")
(:file "source/zzinit")))
"Arithmetic Card Game of Twenty-Four"
\ No newline at end of file
;;
;; Copyright 2013 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;;
;; This source file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file. If not, see
;; <http://www.gnu.org/licenses/>.
;;
;;(in-package :twenty-four)
(in-package :www.genworks.com)
(setf *random-state* (make-random-state t))
(define-object assembly-24 (base-site-sheet)
:computed-slots
((title "HTML Game: Twenty-Four")
(link-title "Twenty-Four")
(valid-numbers? (and (every #'integerp (list (the a) (the b) (the c) (the d)))
(> (the max) (the min))
(integerp (the target value))))
(answers (when (the valid-numbers?)
(twenty-four (the a) (the b) (the c) (the d) :target (the target value))))
(whole-plus-answers (getf (the answers) :whole-plus))
(whole-minus-answers (getf (the answers) :whole-minus))
(fractional-answers (getf (the answers) :fractions))
(right-section-inner-html
(with-cl-who-string ()
(if (or (the entering?) (not (the valid-numbers?)))
(htm
(:h2 "Would you like to Play a Game?")
((:div :id "contact"))
(:p (fmt "Please provide four numbers between ~a and ~a, inclusive, to yield "
(the min) (the max))
(str (the target value)) ":")
(:fieldset
(str (the a-input form-control-string))
(:p (:table
(:tr (:td (str (the a-input form-control-string)))
(:td (str (the b-input form-control-string)))
(:td (str (the c-input form-control-string)))
(:td (str (the d-input form-control-string)))
(:td (str (the randomize-button form-control-string))))
(:tr (:td ((:img :src (the a-card))))
(:td ((:img :src (the b-card))))
(:td ((:img :src (the c-card))))
(:td ((:img :src (the d-card))))
(:td (str (the go-button form-control-string)))))
(:i (:small "card images copyright information: http://www.jfitz.com/cards/"))))
(:p "Preferences:")
((:fieldset :style "text-justify: right;")
(:p (str (the min-input html-string))
(str (the max-input html-string))
(str (the target html-string)))))
(htm
(:h2 (fmt "Here is what I know for ~a:" (the target value)))
((:div :id "contact"))
(if (or (the whole-plus-answers)
(the whole-minus-answers)
(the fractional-answers))
(htm
(:p (str (the try-again-button form-control-string)))
(:p (:table
(:tr (:td ((:img :src (the a-card))))
(:td ((:img :src (the b-card))))
(:td ((:img :src (the c-card))))
(:td ((:img :src (the d-card))))))
(:i (:small "card images copyright information: http://www.jfitz.com/cards/")))
(when (the whole-plus-answers)
(htm (:h3 (fmt "Here are the combinations for ~a, ~a, ~a, and ~a to yield ~a:"
(the a) (the b) (the c) (the d) (the target value)))
(:p (:table (dolist (answer (the whole-plus-answers))
(htm (:tr (:td (fmt "~s = ~d" answer (the target value))))))))))
(when (the whole-minus-answers)
(htm (:h3 "Answers which involve negative numbers the computation:")
(:p (:table (dolist (answer (the whole-minus-answers))
(htm (:tr (:td (fmt "~s = ~d" answer (the target value))))))))))
(when (the fractional-answers)
(htm (:h3 "Answers which involve fractions in the computation:")
(:p (:table (dolist (answer (the fractional-answers))
(htm (:tr (:td (fmt "~s = ~d" answer (the target value)))))))))))
(htm ((:p :class "helpful-tip")
(fmt "Welp, I could not find any combinations for ~a, ~a, ~a, and ~a which yield ~a..."
(the a) (the b) (the c) (the d) (the target value)))))
(:p (str (the try-again-button form-control-string)))))))
(entering? t :settable)
(a (the a-input value))
(b (the b-input value))
(c (the c-input value))
(d (the d-input value))
(a-card (the (random-card-image-for-number (the a))))
(b-card (the (random-card-image-for-number (the b))))
(c-card (the (random-card-image-for-number (the c))))
(d-card (the (random-card-image-for-number (the d))))
(min (the min-input value))
(max (the max-input value))
(number-choices (list-of-numbers (the min) (the max)))
(range (1+ (- (the max) (the min)))))
:functions
((random-card-image-for-number
(number)
(if (<= number 13)
(let ((cards (aref *cards-by-number* (1- number))))
(format nil "/newsite-static/images/cards-classic/~a.png" (nth (random (length cards)) cards)))
"/newsite-static/images/cards-classic/53.png"))
(reset-entering! ()
(the (set-slot! :entering? t)))
(clear! () (dolist (input (list (the a-input)
(the b-input)
(the c-input)
(the d-input)))
(the-object input restore-defaults!)))
(randomize! () (dolist (input (list (the a-input)
(the b-input)
(the c-input)
(the d-input)))
(the-object input (set-slot! :value (1+ (random (the range)))))))
)
:objects
((min-input :type 'menu-form-control
:ajax-submit-on-change? t
:choice-list '(1 2 3 4 5 6 7 8 10)
:default 1
:size 1
:prompt "Min")
(max-input :type 'menu-form-control
:ajax-submit-on-change? t
:choice-list '(8 9 10 11 12 13 14 15 16 17 18 19 20)
:default 10
:size 1
:prompt "Max")
(target :type 'number-form-control
:ajax-submit-on-change? t
:default 24
:prompt "Target Value: "
:size 5)
(a-input :type 'menu-form-control
:ajax-submit-on-change? t
:choice-list (the number-choices)
:size 1
:domain :number
:default 1)
(b-input :type 'menu-form-control
:ajax-submit-on-change? t
:choice-list (the number-choices)
:size 1
:domain :number
:default 1)
(c-input :type 'menu-form-control
:ajax-submit-on-change? t
:choice-list (the number-choices)
:size 1
:domain :number
:default 1)
(d-input :type 'menu-form-control
:ajax-submit-on-change? t
:choice-list (the number-choices)
:size 1
:domain :number
:default 1)
(go-button :type 'button-form-control
:default "Solve!"
:onclick (the (gdl-ajax-call :function-key :set-slot! :arguments (list :entering? nil)
:form-controls
(list (the target)))))
(clear-button :type 'button-form-control
:default "Clear!"
:onclick (the (gdl-ajax-call :function-key :clear!)))
(randomize-button :type 'button-form-control
:default "Randomize!"
:onclick (the (gdl-ajax-call :function-key :randomize!)))
(try-again-button :type 'button-form-control
:default "Try Again..."
:onclick (the (gdl-ajax-call :function-key :reset-entering!)))))
;;
;; Copyright 2013 Genworks International
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it