Today's modifications.

This commit is contained in:
C. Guy Yarvin 2014-06-18 20:27:36 -07:00
parent 6b9b275671
commit 7b095d47c8
6 changed files with 83 additions and 66 deletions

View File

@ -2009,16 +2009,15 @@
q.rey
%+ ~(put by q.rey) num
^- pimp
=+ quo=|=(a=cord :(weld "\"" (trip a) "\""))
%= pip
pez %new
vaz :~ [%ship :(weld "\"" (trip (rsh 3 1 (scot %p our))) "\"")]
vaz :~ [%ship (quo (rsh 3 1 (scot %p our)))]
[%appn (quo app)]
[%port (trip (rsh 3 2 (scot %ui nap)))]
[%auto "true"]
[%oryx "oryx"]
:- %user
:: ?: =(our you)
:: "null"
:(weld "\"" (trip (rsh 3 1 (scot %p you))) "\"")
[%oryx (quo orx.ced)]
[%user (quo (rsh 3 1 (scot %p our)))]
==
sip sip
som ^- seam

View File

@ -1918,12 +1918,6 @@
b
$(a r.a, b [n.a $(a l.a)])
::
+- tur :: turn
|* b=$+([* *] *)
|-
?~ a ~
[n=[p=p.n.a q=(b p.n.a q.n.a)] l=$(a l.a) r=$(a r.a)]
::
+- uni :: union
~/ %uni
|* b=_a
@ -1944,6 +1938,12 @@
$(b [n.b $(b l.b, a [n.a l.a ~]) r.b], a r.a)
$(b [n.b l.b $(b r.b, a [n.a ~ r.a])], a l.a)
::
+- urn :: turn
|* b=$+([* *] *)
|-
?~ a ~
[n=[p=p.n.a q=(b p.n.a q.n.a)] l=$(a l.a) r=$(a r.a)]
::
+- wyt :: depth of map
.+
|- ^- @

View File

@ -2217,18 +2217,19 @@
r=httq ::
== ::
++ kite ,[p=care q=case r=ship s=desk t=spur] :: parsed global name
++ json :: json top level
$% [%a p=(list jval)] :: array
[%o p=(map ,@t jval)] :: object
++ json :: normal json value
$| ~ ::
$% [%a p=(list json)] :: array
[%b p=?] :: boolean
[%o p=(map ,@t json)] :: object
[%n p=@ta] :: number
[%s p=@ta] :: string
== ::
++ jval :: json value
$| ~ :: null
$? json ::
$% [%b p=?] :: boolean
[%n p=@ta] :: number
[%s p=@ta] :: string
== ::
++ jsot :: strict JSON top
$% [%a p=(list json)] :: array
[%o p=(map ,@t json)] :: object
== ::
++ jval json :: XX compatibility
++ lamb :: short path
$% [& p=@tas] :: auto
[| p=twig] :: manual

View File

@ -1,6 +1,6 @@
window.onload = function() {
data = {}
var data = {}
change = function(_data) {
for(i in _data) {
@ -28,6 +28,7 @@ window.onload = function() {
window.urb.send(d)
}
window.urb.send(null);
window.urb.subscribe("frog","goof", function(err,res) {
if(err)
return console.log('cannot connect to frog/goof')

View File

@ -12,6 +12,10 @@
[%rasp gilt]
==
++ move ,[p=bone q=[%give p=gift]]
++ phil
$% [%new ~]
[%add p=(list ,@p)]
==
--
|= *
|_ [hid=hide vat=axle]
@ -23,7 +27,21 @@
++ root
/(scot %p our.hid)/main/(scot %da lat.hid)/app/[app.hid]
::
++ page
++ respond :: respond to message
|= ost=bone
`move`[ost %give %rasp %json *json]
::
++ update :: update subscribers
^- (list move)
%+ turn
^- (list bone)
%+ ~(rep by sup.hid) *(list bone)
|= [p=[p=bone q=[ship path]] q=(list bone)] ^- (list bone)
?. =(/goof +.q.p) q
[p.p q]
send-vat
::
++ render
^- manx
;html
;head
@ -41,14 +59,8 @@
==
==
;body
;p: Hello.
;table#cont ;tbody
;* %+ turn
%+ sort (~(tap by p.vat) ~)
|= [p=[u=@p n=@ud] q=[u=@p n=@ud]] (gth n.p n.q)
|= [u=@p n=@ud]
;tr(id (slag 1 <u>)):(td:(-<u>) td:(-<n>))
== ==
;p: Yo.
;table#cont:tbody;
;p: Select a ship
;button(onclick "goof()"): Give 5 points
==
@ -57,45 +69,49 @@
++ peer
|= [ost=bone you=ship pax=path]
^- [(list move) _+>]
?: =(~ pax)
=. p.vat (~(put by p.vat) you (fall (~(get by p.vat) you) _@ud))
[[ost %give %rust %hymn page]~ +>]
:_ +>
~[(send-vat ost (turn (~(tap by p.vat)) |=([p=@p q=@ud] p)))]
?: =(/ pax)
[ost %give %rust %hymn render]~
[(send-vat ost) ~]
::
++ poke-phil
|= [ost=bone you=ship pil=phil]
=. p.vat
?- -.pil
%new (~(put by p.vat) you (fall (~(get by p.vat) you) _@ud))
%add %- ~(tur by p.vat)
|= [u=@p n=@ud]
?. (lien p.pil |=(a=@p =(a u)))
n
(add 5 n)
==
[[(respond ost) update] +>.$]
::
++ poke-json
|= [ost=bone you=ship jon=json]
^- [(list move) _+>]
~& [%poke [%state p.vat] ost you]
=+ j=(,[%a p=(list ,[%s p=@t])] jon)
=. p.vat
%- ~(tur by p.vat)
|= [u=@p n=@ud]
?. (lien p.j |=([%s p=@t] =((slav %p (cat 3 '~' p)) u)))
n
(add 5 n)
:_ +>+
:- [ost %give %rasp %json jon]
%+ turn
^- (list bone)
%+ ~(rep by sup.hid) *(list bone)
|= [p=[p=bone q=[ship path]] q=(list bone)] ^- (list bone)
?. =(/goof +.q.p) q
[p.p q]
|= o=bone
%+ send-vat o
%+ turn p.j
|= [%s p=@t]
(slav %p (cat 3 '~' p))
~& [%poke-json jon]
%^ poke-phil ost you
^- phil
?+ -.jon !!
%o [%new ~]
%a :- %add
%+ turn p.jon
|= a=json
?> ?=([%s *] a)
(slav %p (cat 3 '~' p.a))
==
::
++ send-vat
|= [o=bone l=(list ,@p)]
:* o %give %rust %json %o
|= ost=bone
=+ luz=(~(tap by p.vat) ~)
^- move
:* ost %give %rust %json %o
^- (map ,@t jval)
%- mo
%+ turn l
|= p=@p
:- (rsh 3 1 (scot %p p)) :- %n
%^ rsh 3 2
(scot %ui (fall (~(get by p.vat) p) _@ud))
%+ turn luz
|= [a=@p b=@ud]
:- (rsh 3 1 (scot %p a))
:- %n
(rsh 3 2 (scot %ui b))
==
--

View File

@ -4,7 +4,7 @@ window.urb = {
auto: auto,
oryx: oryx,
user: user,
appn: "foobug",
appn: appn,
seqn: 0,
seqp: 1,
dely: 0,