Barnaby, almost working.

This commit is contained in:
C. Guy Yarvin 2015-02-24 14:53:31 -08:00
parent afa7d7f752
commit 8b2dfedee2
5 changed files with 52 additions and 39 deletions

View File

@ -267,6 +267,8 @@
?~(duy he-like |=((list ,@c) %|))
?~ dut
+>.$
~& [%he-reject-cal cal]
~& [%he-reject-dut u.dut]
(he-rush %mor [%det u.dut] [%bel ~] ~)
::
++ he-plan :: execute command

View File

@ -21,7 +21,7 @@
%verb :: verbose mode
== ::
$% [%reload p=(list term)] :: reload vanes
[%begin p=(qual @p @p @t gens)] :: start new ship
[%begin p=(qual ,@p ,@p ,@t gens)] :: start new ship
== ::
:: ::
++ gift :: out result <-$
@ -115,8 +115,8 @@
::
++ he-wish-reset
^+ .
=- $_(+ moz (weld zum moz))
^= zum
=- %_(+ moz (weld zum moz))
^= zum ^- (list move)
=+ top=`path`/(scot %p our.hid)/arvo/(scot %da lat.hid)
:- [ost %pass /reset %d %vega (weld top `path`/hoon)]
%+ turn
@ -136,7 +136,7 @@
[ost %pass /reset %d %veer p pax txt]
::
++ he-wish-begin
|= mes=(qual @p @p @t gens)
|= mes=(qual ,@p ,@p ,@t gens)
%_ +>
moz
:_ moz
@ -151,18 +151,17 @@
==
::
++ he-wish
|= wis
%_ +>
moz
%- weld
:_ moz
?- wis
%verb he-wish-verb
%solid he-wish-solid
%reset he-wish-reset
[%reload *] (he-wish-reload +.wis)
[%begin *] (he-wish-begin +.wis)
==
|= wus=(unit helm-wish)
^+ +>
?~ wus
~&(%he-wish-aborted +>)
?- u.wus
%verb he-wish-verb
%solid he-wish-solid
%reset he-wish-reset
[%reload *] !! :: (he-wish-reload +.u.wus)
[%begin *] (he-wish-begin +.u.wus)
==
::
++ he-work :: apply input
|= act=console-action

View File

@ -161,6 +161,7 @@
::
++ se-just :: adjusted buffer
|= lin=(pair ,@ud (list ,@c))
~& [%se-just lin]
^+ +>
=. off ?:((lth p.lin edg) 0 (sub p.lin edg))
(se-show (sub p.lin off) (scag edg (slag off q.lin)))

View File

@ -36,27 +36,38 @@
[%nex ~]
==
==
++ apse :: engine by dialog
|* dog=_(console-dialog)
|= act=console-action
^+ :_ *console-share
:_ *(list console-effect)
?>(?=(%& -.god) *(each ,_p.god ,_+)
?- -.act
%det
=^ dut +>+>.$
%+ remit +.act
|= buf=(list ,@c)
!=(~ (nice:dog (tufa buf)))
=+ foo=`(list console-effect)`?~(dut ~ [[%det u.dut] ~])
:- :- foo
[%| dog]
`console-share`+>+>+<.$
::
%ret
?. =(`& (nice:dog
==
++ apse :: dialog engine
|* dog=(console-dialog)
|% ++ abet `console-share`+>+>- :: resolve
++ dole ::
=+ fov=^+(init:dog [[~ ~] [%& ~]])
|-
=+ fex=[%tan p.fov]
?- -.q.fov
%& [[p=fex q=[~ u=p.q.fov]] +>.$]
%| :- [p=[i=[%pro `console-prompt`p.p.q.fov] t=fex] q=~]
+>.$(dog q.p.q.fov)
==
::
++ init (dole init:dog) :: initialize
++ work
|= act=console-action
^+ init
?- -.act
%det
=^ dut +>+>.$
%+ remit +.act
|= buf=(list ,@c)
!=(~ (nice:dog (tufa buf)))
[[?~(dut ~ [[%det u.dut] ~]) ~] +>+>+<.$]
::
%ret
=+ txt=(tufa buf)
?. =(`& (nice:dog txt))
[[[%bel ~]~ ~] +>+>+<.$]
(dole (kick:dog txt))
==
--
::
++ apply
|= ted=console-edit

View File

@ -17,9 +17,9 @@
|* out=$+(* *) :: output type
$_ ^? |% ::
++ init =< $ :: initial response
%+ pair tanq ::
%+ pair (list tank) ::
%+ each (unit out) ::
(pair console-prompt _.) ::
(pair console-prompt ,_.) ::
++ kick |=(console-input init) :: next response
++ nice $+(console-input (unit ,?)) :: legal/partial
-- ::