Difference between revisions of "TI-BASIC:Typewriter"
From Learn @ Cemetech
Jump to navigationJump to search (Initial automated import) |
(Automated @@ correction) |
||
Line 1: | Line 1: | ||
{{Template:TI-BASIC:Routine | {{Template:TI-BASIC:Routine | ||
− | |picture= | + | |picture= |
|summary=Makes text appear letter by letter | |summary=Makes text appear letter by letter | ||
|input=''Str1'' - Text to be displayed. | |input=''Str1'' - Text to be displayed. | ||
''A,B'' - Row and colum to display text. | ''A,B'' - Row and colum to display text. | ||
− | |output= | + | |output= |
|variable=''A, B, T, Str1'' | |variable=''A, B, T, Str1'' | ||
|compatibility= All TI calculators | |compatibility= All TI calculators | ||
− | |author= | + | |author= |
− | |authors= | + | |authors= |
− | |url= | + | |url= |
− | |download= | + | |download= |
}} | }} | ||
Latest revision as of 22:12, 24 February 2016
Routine Summary
Makes text appear letter by letter
Inputs
Str1 - Text to be displayed. A,B - Row and colum to display text.
Outputs
Variables Used
A, B, T, Str1
Calculator Compatibility
All TI calculators
Download
No download provided.
:For(T,1,length(Str1 :Text(A,B,sub(Str1,1,T :rand(5 :End
We use a For( loop over the length of the string to go through the string letter by letter. In order to make the spacing come out right, instead of figuring out the right coordinate to display each character at, we display the first T characters of the string starting from the beginning. The rand(5) provides a split-second delay to achieve the typewriter effect.
For multiple lines with the typewriter effect, you can combine this routine with the one to Wordwrap_Text.
Error Conditions
- ERR:DOMAIN is thrown if the string doesn't fit entirely on the screen.