JimmyScratchLab Forth.js(a fork of JeForth) Demo
<script type="text/forth">
: c c" pi = 3.14" >tag h1 >tag div >tagid div1 ; c
</script>
<div id='div1'></div>
<script type="text/forth">
: showtable c" WORD" >tag th >tag tr c" Stack" >tag th >tagnode >tagid table1
c" .tag" >tag td >tag tr c" ( str <tagname> -- )" >tag td >tagnode >tagid table1
c" >tagid" >tag td >tag h1 >tag tr c" ( x|node <tagid> -- )" >tag td >tagnode >tagid table1
c" >tag" >tag td >tag tr c" ( x|node <tag> -- node )" >tag td >tagnode >tagid table1
c" >tagnode" >tag td >tag tr c" ( node x|childnode -- node )" >tag td >tagnode >tagid table1
; showtable
</script>
<table id='table1' border="1"></table>
<script type="text/forth">
c" ./forth/testcase.f" include
</script>
<p class="forth" forthcode=" x "> </p>
nil
<p class="forth" forthcode=": 9*9 9 for cr r@ 9 for dup r@ * 2 .r space next drop next ; 9*9">nil</p>
nil
<p class="forth" forthcode=" : fib1 1 1 begin over . swap over + dup 10000 > until 2drop ; fib1">nil</p>
nil
<p class="forth" forthcode=" fib2 ">nil</p>
nil
<p class="forth" forthcode='-16 abs -20 abs -12 abs -9 abs -3 abs -11 abs -8 abs .s c" abs ok!" .tag h1'>nil</p>
nil
<p class="forth" forthcode=" .( *** ) version . .( *** ) ">nil</p>
nil
沒有留言:
張貼留言