Author Topic: OT Basic  (Read 73275 times)

0 Members and 1 Guest are viewing this topic.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: OT Basic
« Reply #45 on: September 03, 2010, 06:34:43 pm »
random function seems like a must to me. Even non-game-programmable calcs, such as cheap scientific ones, had Rand anyway. Sorting commands would be a good addition too.

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: OT Basic
« Reply #46 on: September 03, 2010, 08:59:50 pm »
yeah, rand is good. i forgot about that. i'm think rand 0-1, randint # specified - # specified, randmatrix every value is between two specified numbers and randlist, same thing as randmatrix but for a list. and i know there were suggestions for other data types, so hopefully find a way to get random data types too. sorting would also be good.


Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: OT Basic
« Reply #47 on: September 03, 2010, 09:10:41 pm »
A possibly, somewhat advanced feature would be more list functions. Or rather, array functions ;D
Things like list comprehension, for example. (Example (made up syntax): [x <- list1 | x>5] would return a list that consists of all the elements of list1 that are greater than five)
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline tloz128

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 324
  • Rating: +58/-6
  • I feel asleep.
    • View Profile
Re: OT Basic
« Reply #48 on: September 03, 2010, 11:11:03 pm »
I think that it should support multiple key presses (lack of this is one of the things I hate the most about TI basic).
Naaa... Na Nah Na Nana Na Nah... Hey Jude!

Offline program4

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 158
  • Rating: +15/-0
    • View Profile
Re: OT Basic
« Reply #49 on: September 04, 2010, 04:44:19 pm »
There should be a way to reach all the characters, including the ones normally inaccessible (like the alpha in Omnimaga) from a menu. Also, have more of them  :P

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: OT Basic
« Reply #50 on: September 04, 2010, 06:54:17 pm »
I agree with program4. I find it weird that lowercases are disabled by default and that you need to install a language APP and turn your calc in a different language to access them...

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: OT Basic
« Reply #51 on: September 05, 2010, 09:34:57 pm »
alright so i've been thinking a lot about the data types involved in this, and i think there shouldn't be too many as to confuse the casual programmer, but enough so an advanced programmer can save a lot of memory. thus, here are my suggestions for data types dealing with numbers only, excluding strings or data structures (lists/matrices/arrays) for now:

-Byte holds values -128 to 127, integers only
-2Byte holds values -32768  to 32767, integers only.
-4Byte Word holds values... really big. like -2 billion to 2 billion.
-16.16 fixed point values  -32768.32768 to 32767.32767
-the unsigned versions of the above numbers
-The OS Float, however the OS stores floating point, that's this data type. no unsigned version.

also, maybe have a menu where you can turn on and off advanced features, such as specifying what data type a variable should be. suggestions? also, adding in the array functions, multiple keypresses and foreign characters suggestions to the first post.

Offline shmibs

  • しらす丼
  • Administrator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2132
  • Rating: +281/-3
  • try to be ok, ok?
    • View Profile
    • shmibbles.me
Re: OT Basic
« Reply #52 on: September 05, 2010, 09:55:03 pm »
/\i like(although i dont really see the purpose of word storage other than os calculations...)
a menu sounds nice, too(all number dealings are floating point by default for nubs, but can be set to the others to increase calculation speed)

Offline fb39ca4

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1749
  • Rating: +60/-3
    • View Profile
Re: OT Basic
« Reply #53 on: September 06, 2010, 11:47:33 am »
That would be nice.
For the 16.16 fixed point value, the range would be -32,768 to 32,767.9998...

Offline matthias1992

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 408
  • Rating: +33/-5
    • View Profile
Re: OT Basic
« Reply #54 on: September 06, 2010, 01:48:31 pm »
alright so i've been thinking a lot about the data types involved in this, and i think there shouldn't be too many as to confuse the casual programmer, but enough so an advanced programmer can save a lot of memory. thus, here are my suggestions for data types dealing with numbers only, excluding strings or data structures (lists/matrices/arrays) for now:

-Byte holds values -128 to 127, integers only
-2Byte holds values -32768  to 32767, integers only.
-4Byte Word holds values... really big. like -2 billion to 2 billion.
-16.16 fixed point values  -32768.32768 to 32767.32767
-the unsigned versions of the above numbers
-The OS Float, however the OS stores floating point, that's this data type. no unsigned version.

also, maybe have a menu where you can turn on and off advanced features, such as specifying what data type a variable should be. suggestions? also, adding in the array functions, multiple keypresses and foreign characters suggestions to the first post.

If I am catching you right then you also mean that when a user defines a variable and that variable is a number then the user also has to define what kind of type the number is? e.g.

Byte 1->aVar
Int 123->aOtherV
etc..

If so then I would make this optional in the following sense: If a user defines a variable that contains a number but he/she does not defines the number-variable's type then a floating point is assumed. So:

102->myVar

would be presumed to be a float which, logically, takes up more space then a int. A more advanced programmer therefore would do this:

Int 102->myVar.

Ther is one problem with this, mainly that the very word 'Int' itself takes up space. So maybe it'sbetter to do prefixes (I think we already discussed that but I am not sure...) I suggest these prefixes.

" --string
i --int
r --real
m --matrix
l --list
f -- float
o --bit (based on the 'switch' term... b for bit and f for flag are already used as 'byte' and 'float')
b --byte :=8bits
d --double byte :=16bits
w -- word :=32 bits

example
Code: [Select]
"FooBar->myvar
l0,1,2,3,4->myVar
Disp "I Say : myvar : myVar[1]

In the above example are tow more things:

1. myvar and myVar, shall we make a distinction between the tow? inother words should variables be case sensitive?
2. the ":" (without quotes) sign which would combine several variables and strings into one Disp command. (I originally wanted to use the "&" token but I thought that would be uneasy to access if we were to use a keypad similar to TI's)

Just say what you think about this...

edit in my example code it is seemingly impossible to include the ":" token in a string, this exmaple below however does so:
Code: [Select]
Disp "M says : ": : "Hello

which combines the strings "M says", ":" and "Hello".
maybe "&" is better after all...
« Last Edit: September 06, 2010, 01:58:11 pm by matthias1992 »
MASM xxxxxxxxxx aborted | SADce ====:::::: 40% -Halted until further notice| XAOS =====::::: 50% -Units done| SKYBOX2D engine ========== 100% -Pre-alpha done. Need to  document it and extend |

~Those who dream by day are cognizant of much more than those who dream by night only. -Sir Edgar Allen Poe-

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: OT Basic
« Reply #55 on: March 16, 2011, 05:07:26 pm »
I am interested in developing a programming language. If anybody has seen ReCode, it uses 5 bcalls (one of which isn't needed anymore, but is included to keep compatibility with previous versions). The others are used to create vars, delete vars, and the last is InsertMem and all of those are used for the simple reason that I don't know the OS protocol for that stuff. Other than that, it is a fast interpreted language that currently has sprite support, strings and real numbers, text (not using anything from the OS), and other random things. I think that if I really wanted to I can fit a whole programming language into 16KB, but if I extended it to 32KB I could make the programming environment, all of the tokens and not use the OS at all. The only problem is that I am not familiar with writing to flash (in case variables need to be archived). For those who are not familiar with ReCode, here is a screenshot of an example program:

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: OT Basic
« Reply #56 on: March 16, 2011, 05:10:34 pm »
/\i like(although i dont really see the purpose of word storage other than os calculations...)
a menu sounds nice, too(all number dealings are floating point by default for nubs, but can be set to the others to increase calculation speed)

I don't think floating point should be the default. It's too slow. Perhaps a fixed decimal point would be a better default, since it's faster to compute and slightly more accurate.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: OT Basic
« Reply #57 on: March 16, 2011, 05:13:09 pm »
Actually, I have done some work with BCD math and floating point and to be honest, it isn't all that slow. However, I personally prefer making all of the math routines based on binary and then convert it to decimal only for display purposes.

Offline matthias1992

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 408
  • Rating: +33/-5
    • View Profile
Re: OT Basic
« Reply #58 on: March 16, 2011, 05:50:46 pm »
Sorry to mix up hard and software here but, floating point math should not be that hard if we go for a propellor based design, it has full hardware 32 bit math support and can do float calculations in just one out of eight cores....

So really Floats is more hardware related if speed is an issue...

I figured a third option, eZ80 with a propellor as gpu? I mean, gpu's today are so great because they use stream processors, with a prop that is possible too...
MASM xxxxxxxxxx aborted | SADce ====:::::: 40% -Halted until further notice| XAOS =====::::: 50% -Units done| SKYBOX2D engine ========== 100% -Pre-alpha done. Need to  document it and extend |

~Those who dream by day are cognizant of much more than those who dream by night only. -Sir Edgar Allen Poe-

Offline program4

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 158
  • Rating: +15/-0
    • View Profile
Re: OT Basic
« Reply #59 on: March 16, 2011, 09:06:41 pm »

edit in my example code it is seemingly impossible to include the ":" token in a string, this exmaple below however does so:
Code: [Select]
Disp "M says : ": : "Hello

which combines the strings "M says", ":" and "Hello".
maybe "&" is better after all...

Maybe the ability to add quotation marks to a string would be nice, like using escape code or whatever it's called. Like, the " symbol means you type
Code: [Select]
/" and the / symbol means you type
Code: [Select]
// just like in Java. This would also allow for escape sequences like newline
Code: [Select]
/n