Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :"<>"→Str9
- :0→θ
- :10→dim(∟BCHAT
- :ClrHome
- :Output(8,1,"LOADING..."
- :If not(sum(∟BCHAT
- :Then
- :ClrHome
- :Input "USERNAME:",Str1
- :length(Str1)→∟BCHAT(1
- :If ∟BCHAT(1)>9
- :9→∟BCHAT(1
- :sub(Str1+"{^-1}{^-1}{^-1}{^-1}{^-1}{^-1}{^-1}{^-1}{^-1}",1,9)→Str1
- :For(X,1,9
- :inString("ABCDEFGHIJKLMNOPQRSTUVWXYZ .-+/º'()?",sub(Str1,X,1))→∟BCHAT(X+1)
- :If not(∟BCHAT(X+1
- :37→∟BCHAT(X+1
- :End
- :End
- :"+"→Str2
- :For(X,1,9)
- :Str2+sub("ABCDEFGHIJKLMNOPQRSTUVWXYZ .-+/º'()??",∟BCHAT(X+1),1)→Str2
- :End
- :sub(Str2,2,∟BCHAT(1))→Str2
- :sum(19,1
- :Lbl X
- :sum(19,0
- :ClrHome
- :Output(8,1,"BY CVSOFT v1.0-a"
- :Stop
- :Lbl H
- :ClrHome
- :If Str9≠"<>"
- :Output(1,1,Str9
- :Output(8,1,"SEND EXIT"
- :Lbl K
- :0→X
- :0→K
- :Repeat K or X=33
- :X+1→X
- :getKey→K
- :End
- :If K=11 or K=21 or K=105
- :Goto S
- :If K=15 or K=22 or K=45
- :Goto X
- :Str9→Str8
- :sum(18)
- :If Str9≠Str8
- :Goto H
- :Goto K
- :Lbl S
- :ClrHome
- :Input "<"+Str2+"> ",Str1
- :"<"+Str2+"> "+Str1→Str1
- :sum(18)
- :sum(17,Str1
- :Goto H
- --------------------Explanation of code, in pseudocode--------------------
- Store a dummy value to the received data string and store zero to device id
- Define list BCHAT
- If BCHAT is zero, then:
- Input a username
- Store the length of the username entry string to a maximum length of 9 characters
- Add a bunch of ^-1s to guarantee a length of 9 characters for substringing
- Convert the characters in the username to their positions in a string and store in the username list
- If not found in string, replace with "?"
- (End If)
- Define the username string
- Convert the username list to a string with the inverse process for creation of the list
- Substring any extra characters
- Open the Calcnet2 link
- Goto Homescreen
- Label: eXit
- Close Calcnet2 link
- Stop execution
- Label: Homescreen
- Display recipient's calc ID in row 7
- Display menu options in row 8
- Label :Key_entry
- Define getKey variable
- Define counting variable
- Loop until counting variable reaches 33 or a key is pressed
- If [ENTER], [2nd], or [Y=] (Send menu item) is pressed, Goto Send
- If [CLEAR], [MODE], or [GRAPH] (Exit menu item) is pressed, Goto eXit
- (no usable key was pressed and/or counting variable reached 33)
- Store last received data to a temporary string
- Get the sent string from the other calculator
- If the strings are the same, Goto Key-entry; Else, Goto Homescreen to update display
- Label: Send
- Input message
- Add username in "<username> " format
- (added in a later version)
- Substring if longer than 120 characters (added in a later version)
- Store remote device id to a temporary variable
- Menu to select recipient: if broadcasted, store zero to theta; else, do nothing
- (/added in a later version)
- Calcnet2-Send the message with username attached
- Restore theta to pre-send value
- Goto Homescreen
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement