New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

infer types #1

Open
wants to merge 1 commit into
from
Jump to file or symbol
Failed to load files and symbols.
+133 −3
Diff settings

Always

Just for now

View
@@ -16,6 +16,133 @@
[clojure.spec :as s])
(:gen-class :main true))
;; Start: Generated by clojure.core.typed - DO NOT EDIT
(declare
BasesKlingonsQuadrantMap
ComputerDisplayDamageControlLongRangeSensorsMap
CurrentEndStartMap
CurrentKlingonsCurrentSectorEnterpriseMap
EnergyIsDockedQuadrantMap
EnergySectorMap
PageMap)
(t/defalias
BasesKlingonsQuadrantMap
'{:bases t/Int,
:klingons t/Int,
:quadrant '[t/Int t/Int],
:stars t/Int})
(t/defalias
ComputerDisplayDamageControlLongRangeSensorsMap
'{:computer_display t/Int,
:damage_control t/Int,
:long_range_sensors t/Int,
:phasers t/Int,
:photon_torpedo_tubes t/Int,
:shields t/Int,
:short_range_sensors t/Int,
:warp_engines t/Int})
(t/defalias
CurrentEndStartMap
'{:current t/Int, :end t/Int, :start t/Int})
(t/defalias
CurrentKlingonsCurrentSectorEnterpriseMap
(t/HMap
:mandatory
{:current-klingons (t/Vec EnergySectorMap),
:current-sector (t/Vec t/Int),
:enterprise EnergyIsDockedQuadrantMap,
:quads (t/Vec BasesKlingonsQuadrantMap),
:stardate CurrentEndStartMap,
:starting-klingons t/Int}
:optional
{:lrs-history (t/Vec t/Str)}))
(t/defalias
EnergyIsDockedQuadrantMap
(t/HMap
:mandatory
{:energy t/Int,
:is_docked false,
:quadrant '[t/Int t/Int],
:sector '[t/Int t/Int],
:shields t/Num}
:optional
{:damage ComputerDisplayDamageControlLongRangeSensorsMap,
:photon_torpedoes t/Int}))
(t/defalias EnergySectorMap '{:energy t/Int, :sector '[t/Int t/Int]})
(t/defalias PageMap '{:page t/Str})
(t/ann
clojure.edn/read-string
[t/Str :-> '[PageMap PageMap PageMap PageMap]])
(t/ann clojure.java.io/resource [t/Str :-> java.net.URL])
(t/ann -main [:-> nil])
(t/ann command-help AnyFunction)
(t/ann
game-over-destroyed
[(t/Atom1 CurrentKlingonsCurrentSectorEnterpriseMap) :-> Boolean])
(t/ann game-over-out-of-time AnyFunction)
(t/ann
game-over-powerless
[(t/Atom1 CurrentKlingonsCurrentSectorEnterpriseMap) :-> Boolean])
(t/ann game-over-success AnyFunction)
(t/ann
game-over?
[(t/Atom1 CurrentKlingonsCurrentSectorEnterpriseMap) :-> Boolean])
(t/ann
game-state
(t/Atom1
(t/U
CurrentKlingonsCurrentSectorEnterpriseMap
(t/Map t/Nothing t/Nothing))))
(t/ann library-computer AnyFunction)
(t/ann pages (t/Coll t/Str))
(t/ann parse-number [t/Str :-> t/Int])
(t/ann play-game [:-> nil])
(t/ann print-instructions [t/Int :-> nil])
(t/ann user-input [:-> t/Int])
(t/ann
startrek.enterprise/fire-torpedoes-command
[(t/Atom1 CurrentKlingonsCurrentSectorEnterpriseMap)
:->
(t/Atom1 CurrentKlingonsCurrentSectorEnterpriseMap)])
(t/ann
startrek.enterprise/shield-control-command
[(t/Atom1 CurrentKlingonsCurrentSectorEnterpriseMap)
:->
(t/Atom1 CurrentKlingonsCurrentSectorEnterpriseMap)])
(t/ann
startrek.klingon/klingon-turn
[EnergyIsDockedQuadrantMap
(t/Vec EnergySectorMap)
:->
EnergyIsDockedQuadrantMap])
(t/ann
startrek.nav/enter-quadrant
[(t/Atom1 CurrentKlingonsCurrentSectorEnterpriseMap)
:->
CurrentKlingonsCurrentSectorEnterpriseMap])
(t/ann
startrek.utils/message
(t/IFn
[:-> (t/U nil (t/Vec (t/U nil t/Str)))]
[t/Str :-> (t/U nil (t/Vec (t/U nil t/Str)))]))
(t/ann
startrek.world/long-range-scan-command
[(t/Atom1 CurrentKlingonsCurrentSectorEnterpriseMap) :-> nil])
(t/ann
startrek.world/new-game-state
[(t/Atom1
(t/U
CurrentKlingonsCurrentSectorEnterpriseMap
(t/Map t/Nothing t/Nothing)))
:->
CurrentKlingonsCurrentSectorEnterpriseMap])
(t/ann
startrek.world/remaining-klingon-count
[(t/Vec BasesKlingonsQuadrantMap) :-> t/Int])
(t/ann
startrek.world/short-range-scan-command
[(t/Atom1 CurrentKlingonsCurrentSectorEnterpriseMap) :-> nil])
;; End: Generated by clojure.core.typed - DO NOT EDIT
(def game-state (atom {}))
(def pages
@@ -35,7 +162,7 @@
(read-string s2)))))
(defn print-instructions [pause]
(loop [p pages]
(loop [^{::t/ann (t/Coll t/Str)} p pages]
(when (seq p)
(println (first p))
(when (= pause 2)
@@ -136,12 +263,15 @@
"5" (e/shield-control-command game-state)
"6" (e/damage-control-report-command game-state)
"7" (c/computer-command game-state)
"q" (dosync (alter stop-condition (fn [_] true)))
"q" (dosync (alter stop-condition (t/ann-form
(fn [_] true)
[false :-> Boolean])
))
(command-help)
)))))))
(defn -main [& args]
(dotimes [i 20]
(dotimes [^{::t/ann t/Int} i 20]
(println))
(println " STAR TREK ")
(println)