* WalrusIRC

You need to have 5 posts and not be part of restricted usergroups in order to use the WalrusIRC embedded shoutbox. However, you can also access our IRC channel called #CodeWalrus via EFnet.

Author Topic: TI-BASIC terminal  (Read 1315 times)

0 Members and 1 Guest are viewing this topic.

Offline JWinslow23

  • Pi is the coolest number in the history of math. :\
  • Super User
  • CW 4x3 challenge - 2nd place
  • *
  • Join Date: May 2015
  • Location: Somewhere between 13 and Graham's Number
  • Posts: 762
  • Post Rating Ratio: +13/-1
  • Use pi! Pi is the absolute greatest! :(
    • @UCu_9qD95nADzc-W6RN-3Z8A
    • 113/11328
  • Gender: Male
TI-BASIC terminal
« on: November 11, 2016, 10:24:35 pm »
I made a TI-BASIC terminal-style scheme for input and input processing.



The input is already all taken care of. You can input letters, spaces, and numbers (I might revamp this, because on hindsight, I might not need numbers except for special cases). What I think is innovative about this is the scrolling and input processing.

The scrolling works like this: Str9 contains each line, with a boxplot character at the end (basically, any character I'm sure won't appear in the string), and L1 contains the x-positions of the text. Each are shifted as a new line is added, and the screen is redrawn.

The input processing is a little more clever: Str1 is stripped of extraneous spaces, and separated by keyword. If a keyword is found, a code (unique for each keyword) is added to Str2. Then, Str2 is searched for each combination of keywords that do commands, and then that command is done.

To add a keyword:
In CPROCESS, there are lines that go like this:
Code: [Select]
sub(Str1,A,Ans-A
{Ans="QUIT" or Ans="EXIT" or Ans="DONE" or Ans="BYE" or Ans="GOODBYE" or Ans="CYA",Ans="TEST" or Ans="TESTING",Ans="HI" or Ans="HELLO" or Ans="HEY" or Ans="HEYA" or Ans="HIYA" or Ans="YO",Ans="WHAT" or Ans="WHATS" or Ans="WHATZ" or Ans="WTF" or Ans="WOT" or Ans="WOTS" or Ans="WOTZ" or Ans="WAT" or Ans="WATS" or Ans="WATZ" or Ans="WUT" or Ans="WUTS" or Ans="WUTZ",Ans="UP",Ans="WASSUP" or Ans="WAZZUP" or Ans="SUP",Ans="HOW",Ans="ARE" or Ans="R",Ans="YOU" or Ans="YA" or Ans="U",Ans="WHO",Ans="YOUR" or Ans="UR" or Ans="YUR",Ans="NAME" or Ans="NAEM",Ans="CALLED" or Ans="CALLD",Ans="SMART",Ans="REAL",Ans="MALE" or Ans="MAN" or Ans="BOY" or Ans="DUDE",Ans="FEMALE" or Ans="WOMAN" or Ans="GIRL" or Ans="LADY",Ans="GENDER" or Ans="SEX",Ans="STUPID" or Ans="DUMB" or Ans="IDIOT" or Ans="MORON"
If max(Ans
Str2+sub("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZθ",1+sum(not(cumSum(Ans))),1→Str2
First, make sure there are enough characters in the giant string in the bottom. Add some if necessary.
In the expression in the second line, add a piecewise expression with the number of the keyword and the keyword itself like this:
Ans="KEYWORD",
The Nth character in that giant string in the bottom is the corresponding character for your keyword, so remember it.
Note: multiple words can be assigned to one code, but one code cannot match more than one word.

To add a command:
Commands are strings of keyword codes. For example, in the example program, "398C" represents "WHAT ARE YOU CALLED".
In CCOMMAND, add a section like this:
Code: [Select]
If inString(Str2,"command
Then
command code goes here
Goto E
End
To output a line of text, do this:
Code: [Select]
"OUTPUT→Str1
XPOS→L₁(9:IS_NEWLINE→L₁(10
prgmCSCROLL
OUTPUT is your output line, XPOS is the X-position of the line, and IS_NEWLINE is 0 if this line overwrites the last line, and 1 if it scrolls up.

Questions? Ask me, and I'll try to clarify. Keep in mind, however, this may not be bug-free or optimized fully. If anyone is willing to help, that would be swell.

Download attached.
« Last Edit: November 15, 2016, 08:38:38 pm by JWinslow23 »


  • Calculators owned: TI-84+, TI-84+ CSE, TI-84+ CE

Offline xMarminq_

  • Full User
  • Join Date: Sep 2016
  • Location: Generic Location
  • Posts: 461
  • Post Rating Ratio: +3/-0
  • Generic Personal Text
    • @UCUWQR30oIW2fRqCNI2IDGIA
  • Gender: Male
Re: TI-BASIC terminal
« Reply #1 on: November 11, 2016, 10:43:47 pm »
Trying to make Siri...
 ;)
  • Calculators owned: Ti-84 Plus CE, Ti-84 Plus (can be borrowed from my school)
I don't associate with associations

Offline p2

  • CodeWalrus Staff
  • Super User
  • Moderator
  • CodeWalrus Supporter
  • *
  • Join Date: Aug 2016
  • Location: Germany
  • Posts: 2300
  • Post Rating Ratio: +9/-0
  • *Wubba lubba dub dub*
    • KaliPhobos
  • Gender: Male
Re: TI-BASIC terminal
« Reply #2 on: November 14, 2016, 10:17:23 am »
there's a Axe command to "move" the screen content upwards (what's off the upper border is shown on the buttom) which is affecting the entire calc (not just the graphics screen).
it should be possible in HEx, too, o you could implement it.
I think it sohould be faster than your current scrolling :)

But I'm really surprised how well your program works :)  :thumbsup:
  • Calculators owned: ti-83+, ti-84+, ti-84+, ti-84+se, ti-84+se(te), ti-nsphire, ti-nsphire CX-CAS, ti-voyage, ti-voyage, Who reads this list anyways...?
Anyway war sucks. Just bring us your food instead of missiles  :P ~ DJ Omnimaga (11.10.2016 20:21:48)
if you cant get a jframe set up, draw stuff to it, and receive input, i can only imagine how horrible your game code is _._   ~ c4ooo (14.11.2016 22:44:07)
If they pull a Harambe on me tell my family I love them ~ u/Pwntear37d (AssangeWatch /r/)
make Walrii great again ~ DJ Omnimaga (28.11.2016 23:01:31)
God invented the pc, satan the smartphone I guess ~ p4nix (16.02.2017 22:51:49)

Offline JWinslow23

  • Pi is the coolest number in the history of math. :\
  • Super User
  • CW 4x3 challenge - 2nd place
  • *
  • Join Date: May 2015
  • Location: Somewhere between 13 and Graham's Number
  • Posts: 762
  • Post Rating Ratio: +13/-1
  • Use pi! Pi is the absolute greatest! :(
    • @UCu_9qD95nADzc-W6RN-3Z8A
    • 113/11328
  • Gender: Male
Re: TI-BASIC terminal
« Reply #3 on: November 14, 2016, 11:02:11 pm »
there's a Axe command to "move" the screen content upwards (what's off the upper border is shown on the buttom) which is affecting the entire calc (not just the graphics screen).
it should be possible in HEx, too, o you could implement it.
I think it sohould be faster than your current scrolling :)

But I'm really surprised how well your program works :)  :thumbsup:
This is a TI-BASIC proof of concept; obviously Asm/Axe would be more capable ;) (I think the command you're referencing would be ZInterval? Not quite what I'd want, but good to know) . In fact, if this were entirely in Axe, all the better! The one problem is that string processing would be a bit more involved, because the language is low-level when it comes to any data processing. Who knows, though? If that's code-able, you could see CALSPEAK grace a full-fledged Asm program!

Thank you, by the way. I appreciate it!

Offline xlibman

  • Omni founder & CW co-founder
  • Super User
  • Original 5
  • CodeWalrus Supporter
  • *
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 18872
  • Post Rating Ratio: +99/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • DJ Omnimaga music store
  • Gender: Male
Re: TI-BASIC terminal
« Reply #4 on: November 14, 2016, 11:09:17 pm »
So this is kinda like a chat bot? I kinda like it so far considering it's TI-BASIC. It looks nice too.
  • Calculators owned: TI-57, 73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)

Offline Snektron

  • Lvl 69 Russian Snake
  • Super User
  • Join Date: Dec 2014
  • Location: Netherlands
  • Posts: 3165
  • Post Rating Ratio: +32/-0
  • SSSssssss.....
    • RobinDeWalvis
    • Kzyrox
    • RobinDeWalvis
    • quantuminfinity
  • Gender: Male
Re: TI-BASIC terminal
« Reply #5 on: November 14, 2016, 11:16:47 pm »
Looks pretty cool :) nice work

there's a Axe command to "move" the screen content upwards (what's off the upper border is shown on the buttom) which is affecting the entire calc (not just the graphics screen).
it should be possible in HEx, too, o you could implement it.
I think it sohould be faster than your current scrolling :)

But I'm really surprised how well your program works :)  :thumbsup:
This is a TI-BASIC proof of concept; obviously Asm/Axe would be more capable ;) (I think the command you're referencing would be ZInterval? Not quite what I'd want, but good to know) . In fact, if this were entirely in Axe, all the better! The one problem is that string processing would be a bit more involved, because the language is low-level when it comes to any data processing. Who knows, though? If that's code-able, you could see CALSPEAK grace a full-fledged Asm program!

Thank you, by the way. I appreciate it!
String processing is definitely capable in assembly, but it does require some work. Most functions are pretty trivial though (you could for examples take a look at KnightOS's string functions ;))
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Offline JWinslow23

  • Pi is the coolest number in the history of math. :\
  • Super User
  • CW 4x3 challenge - 2nd place
  • *
  • Join Date: May 2015
  • Location: Somewhere between 13 and Graham's Number
  • Posts: 762
  • Post Rating Ratio: +13/-1
  • Use pi! Pi is the absolute greatest! :(
    • @UCu_9qD95nADzc-W6RN-3Z8A
    • 113/11328
  • Gender: Male
Re: TI-BASIC terminal
« Reply #6 on: November 15, 2016, 08:22:06 pm »
Oh right, forgot to upload my latest version.

Latest version up there. It demonstrates the capabilities of this engine with a chatbot named "CALSpeak".
Basically, CALSpeak is a chabot using the Terminal engine that has answers to a few select phrases (and I'll update it to have some more, too). As it stands, it can give you a greeting, tell you what's up, tell you how it is, tell you its name, tell you its gender, tell you its intelligence, and reflect on its state of reality.

I have a screenshot right here.


Perhaps someone can use this for a text adventure? That would certainly be welcome.

Offline xlibman

  • Omni founder & CW co-founder
  • Super User
  • Original 5
  • CodeWalrus Supporter
  • *
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 18872
  • Post Rating Ratio: +99/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • DJ Omnimaga music store
  • Gender: Male
Re: TI-BASIC terminal
« Reply #7 on: December 05, 2016, 07:37:21 am »
Cool, I'm definitively giving it a try when I get a chance. Is it me, though, or is text typing slow? I have the feeling that that part could probably be improved, but I'm unsure.
  • Calculators owned: TI-57, 73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)

 


You can also use the following HTML or bulletin board code to share it on your page or forum signature!


Also do not forget to check our affiliates below.
Planet Casio TI-Planet Calc.news BroniesQC BosaikNet Velocity Games