mirror of
https://github.com/urbit/shrub.git
synced 2024-12-12 10:29:01 +03:00
Tank hax!
This commit is contained in:
parent
26065f3a68
commit
05a39ac52f
@ -844,7 +844,7 @@
|
|||||||
::
|
::
|
||||||
++ can :: assemble
|
++ can :: assemble
|
||||||
~/ %can
|
~/ %can
|
||||||
|= [a=bloq b=(list ,[p=@ q=@])]
|
|= [a=bloq b=(list ,[p=@u q=@])]
|
||||||
^- @
|
^- @
|
||||||
?~ b 0
|
?~ b 0
|
||||||
(mix (end a p.i.b q.i.b) (lsh a p.i.b $(b t.b)))
|
(mix (end a p.i.b q.i.b) (lsh a p.i.b $(b t.b)))
|
||||||
@ -856,16 +856,16 @@
|
|||||||
::
|
::
|
||||||
++ cut :: slice
|
++ cut :: slice
|
||||||
~/ %cut
|
~/ %cut
|
||||||
|= [a=bloq [b=@ c=@] d=@]
|
|= [a=bloq [b=@u c=@u] d=@]
|
||||||
(end a c (rsh a b d))
|
(end a c (rsh a b d))
|
||||||
::
|
::
|
||||||
++ end :: tail
|
++ end :: tail
|
||||||
~/ %end
|
~/ %end
|
||||||
|= [a=bloq b=@ c=@]
|
|= [a=bloq b=@u c=@]
|
||||||
(mod c (bex (mul (bex a) b)))
|
(mod c (bex (mul (bex a) b)))
|
||||||
::
|
::
|
||||||
++ fil :: fill bloqstream
|
++ fil :: fill bloqstream
|
||||||
|= [a=bloq b=@ c=@]
|
|= [a=bloq b=@u c=@]
|
||||||
=+ n=0
|
=+ n=0
|
||||||
=+ d=c
|
=+ d=c
|
||||||
|- ^- @
|
|- ^- @
|
||||||
@ -875,7 +875,7 @@
|
|||||||
::
|
::
|
||||||
++ lsh :: left-shift
|
++ lsh :: left-shift
|
||||||
~/ %lsh
|
~/ %lsh
|
||||||
|= [a=bloq b=@ c=@]
|
|= [a=bloq b=@u c=@]
|
||||||
(mul (bex (mul (bex a) b)) c)
|
(mul (bex (mul (bex a) b)) c)
|
||||||
::
|
::
|
||||||
++ met :: measure
|
++ met :: measure
|
||||||
@ -912,7 +912,7 @@
|
|||||||
::
|
::
|
||||||
++ rsh :: right-shift
|
++ rsh :: right-shift
|
||||||
~/ %rsh
|
~/ %rsh
|
||||||
|= [a=bloq b=@ c=@]
|
|= [a=bloq b=@u c=@]
|
||||||
(div c (bex (mul (bex a) b)))
|
(div c (bex (mul (bex a) b)))
|
||||||
::
|
::
|
||||||
++ swap |=([a=bloq b=@] (rep a (flop (rip a b)))) :: reverse bloq order
|
++ swap |=([a=bloq b=@] (rep a (flop (rip a b)))) :: reverse bloq order
|
||||||
@ -1139,12 +1139,12 @@
|
|||||||
/lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes'
|
/lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes'
|
||||||
|%
|
|%
|
||||||
++ ind ~/ %ind
|
++ ind ~/ %ind
|
||||||
|= a=@
|
|= a=@tas
|
||||||
=+ b=0
|
=+ b=0
|
||||||
|- ^- (unit ,@)
|
|- ^- (unit ,@)
|
||||||
?:(=(256 b) ~ ?:(=(a (tod b)) [~ b] $(b +(b))))
|
?:(=(256 b) ~ ?:(=(a (tod b)) [~ b] $(b +(b))))
|
||||||
++ ins ~/ %ins
|
++ ins ~/ %ins
|
||||||
|= a=@
|
|= a=@tas
|
||||||
=+ b=0
|
=+ b=0
|
||||||
|- ^- (unit ,@)
|
|- ^- (unit ,@)
|
||||||
?:(=(256 b) ~ ?:(=(a (tos b)) [~ b] $(b +(b))))
|
?:(=(256 b) ~ ?:(=(a (tos b)) [~ b] $(b +(b))))
|
||||||
|
@ -2193,7 +2193,7 @@
|
|||||||
++ dlab :: 2396 domainlabel
|
++ dlab :: 2396 domainlabel
|
||||||
%+ sear
|
%+ sear
|
||||||
|= a=@ta
|
|= a=@ta
|
||||||
?.(=('-' (rsh 3 a (dec (met 3 a)))) [~ u=a] ~)
|
?.(=('-' (rsh 3 (dec (met 3 a)) a)) [~ u=a] ~)
|
||||||
%+ cook cass
|
%+ cook cass
|
||||||
;~(plug aln (star alp))
|
;~(plug aln (star alp))
|
||||||
::
|
::
|
||||||
|
@ -166,7 +166,8 @@
|
|||||||
case 13: // %retn
|
case 13: // %retn
|
||||||
if(e.shiftKey) return true
|
if(e.shiftKey) return true
|
||||||
v = prom.val().replace(/\xa0/g, ' ')
|
v = prom.val().replace(/\xa0/g, ' ')
|
||||||
cont.textContent += '\n' + prem.textContent + '\n' + v
|
$(cont).append($('<b>').html(prem.innerHTML),
|
||||||
|
$('<span>').text(v))
|
||||||
|
|
||||||
jpok('line', v)
|
jpok('line', v)
|
||||||
hist.unshift(v)
|
hist.unshift(v)
|
||||||
@ -214,7 +215,16 @@
|
|||||||
if(dat.data.ok) return;
|
if(dat.data.ok) return;
|
||||||
hist = dat.data.history
|
hist = dat.data.history
|
||||||
hind = 0
|
hind = 0
|
||||||
cont.textContent = dat.data.lines.join('\n')
|
cont.innerHTML = ''
|
||||||
|
for(var i in dat.data.lines){
|
||||||
|
var lom = dat.data.lines[i]
|
||||||
|
if(typeof lom == 'string')
|
||||||
|
$(cont).append($('<div>').text(lom))
|
||||||
|
else {
|
||||||
|
$(cont).append($('<b>').html(lom.prompt).append('> '),
|
||||||
|
$('<span>').text(lom.task))
|
||||||
|
}
|
||||||
|
}
|
||||||
window.scrollTo(0,document.body.scrollHeight)
|
window.scrollTo(0,document.body.scrollHeight)
|
||||||
prem.textContent = dat.data.prompt + '> '
|
prem.textContent = dat.data.prompt + '> '
|
||||||
})
|
})
|
||||||
@ -282,7 +292,7 @@
|
|||||||
(spam pax)
|
(spam pax)
|
||||||
::
|
::
|
||||||
%line
|
%line
|
||||||
=. r.tel :_(r.tel leaf/"{(trip p.tel)}> {(trip p.jof)}")
|
=. r.tel :_(r.tel rose/["> " ~ ~]^~[leaf/(trip p.tel) leaf/(trip p.jof)])
|
||||||
=. hiz (~(put by hiz) pax tel)
|
=. hiz (~(put by hiz) pax tel)
|
||||||
?: =('\\' (end 3 1 p.jof))
|
?: =('\\' (end 3 1 p.jof))
|
||||||
$(jof [%cmd (rsh 3 1 p.jof)])
|
$(jof [%cmd (rsh 3 1 p.jof)])
|
||||||
@ -356,10 +366,10 @@
|
|||||||
:~ [%prompt %s p.tel]
|
:~ [%prompt %s p.tel]
|
||||||
[%history %a (turn q.tel |=(a=cord [%s a]))]
|
[%history %a (turn q.tel |=(a=cord [%s a]))]
|
||||||
:+ %lines %a
|
:+ %lines %a
|
||||||
%- turn :_ jape
|
%- zing ^- (list (list json))
|
||||||
^- wall %- zing
|
%- flop %+ turn r.tel |= a=tank
|
||||||
^- (list wall)
|
?. ?=([%rose [[%'>' %' ' ~] ~ ~] [%leaf *] [%leaf *] ~] a)
|
||||||
%- flop
|
(turn (wash 0^80 a) jape)
|
||||||
(turn r.tel (cury wash 0 80))
|
[(jobe prompt/(jape p.i.q.a) task/(jape p.i.t.q.a) ~)]~
|
||||||
==
|
==
|
||||||
--
|
--
|
||||||
|
Loading…
Reference in New Issue
Block a user