typewriter fertig. <animation> und <tw> implementiert und fertig

master
Denis Knauf 2011-01-16 13:33:07 +01:00
parent ed28a880c2
commit 21931e95ed
2 changed files with 23 additions and 17 deletions

View File

@ -29,9 +29,17 @@
endcase nip endcase nip
; ;
: typewriter-type ( addr len -- ) over + swap +do 10 ms i @ emit loop ; variable typewriter-delay
variable ptype-lenl \ Wieviele Zeichen bereits in dieser Zeile geschrieben wurden : typewriter-type ( addr len -- )
typewriter-delay @ -rot
over + swap +do
dup ms i @ emit
loop
drop
;
50 typewriter-delay !
variable ptype-lenl \ Wieviele Zeichen bereits in dieser Zeile geschrieben wurden
defer ptype-type defer ptype-type
' type is ptype-type ' type is ptype-type
: ptype-word ( addrw addrc c -- addrc+1 ) : ptype-word ( addrw addrc c -- addrc+1 )
@ -49,7 +57,6 @@ defer ptype-type
) )
; ;
: ptype-newline ( lenm lenl addrw addrc -- lenm 0 addrw ) : ptype-newline ( lenm lenl addrw addrc -- lenm 0 addrw )
\ s\" is a newline\n" type
10 ptype-word \ lenm lenl addrw=addrc+1 10 ptype-word \ lenm lenl addrw=addrc+1
nip 0 swap \ lenm lenl=0 addrw nip 0 swap \ lenm lenl=0 addrw
; ;
@ -86,7 +93,7 @@ defer ptype-type
endcase endcase
loop \ addre lenm lenl addrw loop \ addre lenm lenl addrw
over ptype-lenl ! over ptype-lenl !
nip nip tuck - type nip nip tuck - ptype-type
; ;
: ptype ( addr len -- ) term-width ptype-lenl @ ptype-init ptype' ; : ptype ( addr len -- ) term-width ptype-lenl @ ptype-init ptype' ;
: ptype-reset ( -- ) 0 ptype-lenl ! ; : ptype-reset ( -- ) 0 ptype-lenl ! ;
@ -123,9 +130,12 @@ ptype-reset \ ptype-lenl sollte von Anfang an 0 sein
: </bc> ( -- ) ['] {/bc} , ; : </bc> ( -- ) ['] {/bc} , ;
: {br} ( addr -- addr ) cr ptype-reset ; : {br} ( addr -- addr ) cr ptype-reset ;
: <br> ( -- , xt-{br} ) ['] {br} , ; : <br> ( -- , xt-{br} ) ['] {br} , ;
\ : {animation} ( addr -- addr ) cell+ @ is ptype-type ; : {animation} ( addr , xt -- addr ) dup @ ['] ptype-type defer! cell+ ;
\ : <animation> ( -- addr u- , xt-{animation} 0 ) ['] {animation} , ' , ; : <animation> ( xt -- addr u- , xt-{animation} xt ) ['] {animation} , , ;
\ : </animation> ( -- ) ['] {/animation} , ; : {/animation} ( addr -- addr ) ['] type is ptype-type ;
: </animation> ( -- , xt-{/animation} ) ['] {/animation} , ;
: <tw> ( -- , xt xt ) ['] typewriter-type <animation> ;
: </tw> ( -- , xt ) </animation> ;
\ Es folgen ein paar blockorientierte Kennzeichnungen. \ Es folgen ein paar blockorientierte Kennzeichnungen.
: {h} ( addr , len -- addr ) : {h} ( addr , len -- addr )
cr cr

View File

@ -41,19 +41,15 @@
<presentation> <presentation>
<h> !" Dies ist eine Testpraesentation!" </h> <h> !" Dies ist eine Testpraesentation!" </h>
<p> <p>
!" Eines Tages hatten wir [" <b> !" Harald Steinlechner" </b> !" Eines Tages hatten wir [" <b> <tw> !" Harald Steinlechner" </tw> </b>
!" und " <b> !" Denis Knauf" </b> !" und " <b> <tw> !" Denis Knauf" </tw> </b>
!" ] die tolle Idee, eine Praesentationssoftware zu schreiben." !" ] die tolle Idee, eine Praesentationssoftware zu schreiben."
<br> </p>
<br> <en>
<b> <||> !" erstens" </||>
<en>
<||> !" erstens" </||>
<||> !" zweitens" </||> <||> !" zweitens" </||>
<||> !" dann" </||> <||> !" dann" </||>
</en> </en>
</b>
</p>
<np> <np>
<h> !" Ergebnis" </h> <h> !" Ergebnis" </h>
<p> <b> !" Das hier" </b> </p> <p> <b> !" Das hier" </b> </p>