Jump to content



Photo
- - - - -

Classpad BASIC Standard Library


  • Please log in to reply
99 replies to this topic

#1 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 02 December 2003 - 02:37 AM

hello, this topic will be for the creation of a Classpad standard library for BASIC programs, this will be a community project so anyone can contribute a program. the goal of this project will be to create a set of functions that can be used by anyone that wants to program in BASIC on their classpad. Each program will be stored in the library folder of the classpad so that it can be accessed from any other folder without specifying a path (ex: library/printf() will work as just printf() ). Another goal of the library is to reduce the size of programs stored on the classpad so that we have more room for big projects, if a person uses the library in their program instead of making new functions to do the same thing then they can greatly reduce the size of their program as well as save time and effort, eventually the space saved by the library will surpass the size of the library itself.

the library will not be restricted to program functions, it will also contain usefull math functions that programs and the user will be able to acess (via the keyboard). those who do not think they can contribute a program can aid the cause by creating such a function.

here are the rules of the library:

the library is:
- A collection of usefull programs and functions made to expidite and aid the creation of BASIC programs.
- A self contained environment relying on no outside data.
- A reliable developement tool.
- Backwards compatible to previous versions and has all the previous versions archived for refrence and use.
- An open source community project.

the programs in the library shall be:
- bug free or as bug free as possible.
- available for editing to anyone wishing to do so.
- documented in english.
- approved by the project leader (me).
- quality programming.
- fast and efficient as possible.
- dependant on no programs or variables other than those found in the library (ex: printl uses printf).
- able to return values in one of two ways: by including in the prameter list a string of the variable to store the value in, or by storing the value in the global variable RTN, the method used shall be specified in the documentation.
- documented using the required header and in the standard library documentation.
- a self contained environment using no global variables, with the exception of those defined in the library (ex: RTN).

the functions in the library shall be:
- commonly used and usefull math functions.
- documented in english
- approved by the project leader (me).
- dependant on no programs or variables other than those found in the library. (i dont think this is a problem)

the required header for a program in the library is:
'program name
'standard BASIC library
'Version: #.##
'brief explenation
'return type: PRAM/RTN/NONE
'Parameters:
'pram 1-...
'pram n-...
so the header for printf will be:
'printf
'standard BASIC library
'Version: 1.02
'prints a formatted string; _ creates a line break, [P] creates a new page with pause for keypress.
'Return type: NONE
'Parameters:
'str- a string to be displayed with formatting.

greater documentation must be included in the form of a post in this topic, the info from that post will be included in a text file included in the DEV version of the stdlib that will include documentation of all the libraries functions. this document will not be included in release versions of the library in order to save space, however it will be available on my web site.

Rules of submission:
Anyone wishing to submit a program for the library must either send me their program or post a link to in this topic. the program must be uncompressed and within the guidelines of the library to be accepted.
Any program that already exists in the library that anyone feels can be made better can be resubmitted by anyone (not just the original author) and if the new version proves better then it will replace the previous version in the next release of the library.

Some benifits of the library:
the library will allow us to combine our programming abilities and spread the capabilities of the most talented or experianced programmers down to the newer programmers, it will provide a way to make extensive and complicated programs without having to remake things others have already perfected. Due to the nature of the library folder old programs will not stop working as the library is expanded and changed, if a old program no longer works with the current version of the manager then the programmer (or anyone) can simply include the old version of what ever function they need in the folder their game is in, this will over ride the library and use the appropriate function, no changes to the programming will be required. this same tchnique will work if someone wants to alter a function of the library to better suit their program, they simply put their version in their folder and they (and people using their program) can use the library as normal, but the one function will be used diffrently for that program.

Programmers:
- CrimsonCasio
- Overlord
- Bitwhise
- XF007
- Nanard

Programs:
- printf
- printl
- waitkey
- waitpen
- isdef
- require
- retrn
- textf
- error
- polyline
- checkver
- tmenu
- lcmp
(others in various states of compleation)

Functions:
- round
- penx
- peny

Global Variables:
Misc:
- RTN
Keycodes:
- kKEYB
- kON
- kBACK
- kCLR
- kUP
- kLEFT
- kDOWN
- kRIGHT
- kEQUAL
- kX
- kY
- kZ
- kPWR
- kDEVIDE
- k0
- k1
- k2
- k3
- k4
- k5
- k6
- k7
- k8
- k9
- kLPREN
- kTIMES
- kRPREN
- kMINUS
- kCOMMA
- kPLUS
- kPERIOD
- kEXP
- kEXE


to submit a program/function simply post in this topic, I hope to see everyone participate in this project, I'm sure all of you can contribute something :)

#2 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 02 December 2003 - 05:38 PM

I've added a few things today as well as compleated the waitkey and waitpen functions:

waitkey(key)
- waitkey can accept a string or a number, if given a string waitkey will wait for a button to be pressed and store the value into a variable contained in the string. if given a number it will wait for the key that corresponds to that number to be pressed.

waitpen(coord)
- waitpen can also take two types of parameter, if given a string it will wait for the user to touch a place on the screen and will then store the coordinate in the variable specified in the string in the form {x,y}. if given a 3 dimentional list the program will wait for the pen to touch an area centered arround coord1,coord2 with a size of coord3.

global variables: these variables have been added to the standard library.
Keycodes:
- kKEYB, kON, kBACK, kCLR, kUP, kLEFT, kDOWN, kRIGHT, kEQUAL, kX, kY, kZ, kPWR, kDEVIDE, k0, k1, k2, k3, k4, k5, k6, k7, k8, k9, kLPREN, kTIMES, kRPREN, kMINUS, kCOMMA, kPLUS, kPERIOD, kEXP, kEXE

these variables contain values that can be returned by getkey and can be used instead of writing out the number they contain.

#3 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 02 December 2003 - 08:29 PM

ok, I've been busy and I just finished 6 more functions:

isdef(var):
- checks to see is a variable is defined, RTN=0 if not, 1 if it is.
require(var):
- uses isdef() and error() to make sure a variable exists, then outputs an error if it does not.
retrn(data):
- sets the value of RTN to data, since RTN must be assigned a value with library\RTN this is more effective.
textf(str):
- same as printf but puts text on the graph instead of the text window.
error(msg):
- outputs a error message and stops program execution.
polyline(coords):
- draws a line connecting any number of points, parameter is an array of any size (size must be even).

#4 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 04 December 2003 - 12:43 AM

ok, I have an actuall link to download what exists of the library so far, I havent put the headers on everything yet, but I will soon.

http://www.crimsonca...b.php#downloads

#5 Andy.Davies

Andy.Davies

    Forum Ghost

  • [Legends]
  • PipPipPipPipPipPipPipPip
  • 1547 posts
  • Gender:Male
  • Location:Dorset, England
  • Interests:Age: 18
    Studying: MEng in cybernetics at Reading uni
    Interests: Progaming (VB, VB.Net, C#, Casio Basic)
    Computers UBBD (Using, Building, Breaking & Destroying)
    Gaming (FPS, RTS, RPG)
    Electronics
    Rock Music (Preferably Loud)
    Riley's (Pool & Snooker Bar)
    Driving (Preferably fast)
    Aikedo (Martial Art)

  • Calculators:
    Algebra FX 2.0 ROM 1.01, FX9750G

Posted 04 December 2003 - 09:36 AM

sounds good, but absolutly to use to me cos i dont have a classpad ;) :o

#6 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 08 December 2003 - 07:10 PM

is there a way to do {1,2,3}={1,2,3} and have it make sure each cell is the same? if not I've written a function to do it (without a loop) that might be usefull... but I need to know if there is a built in way.

#7 BiTwhise

BiTwhise

    Casio Overgod

  • [Legends]
  • PipPipPipPipPipPipPip
  • 627 posts
  • Gender:Male
  • Location:Guildford, Surry, UK
  • Interests:Programming, games, consoles, martial arts

  • Calculators:
    FX9700WE, CFX9970G, AFX2.0, Classpad 300

Posted 08 December 2003 - 08:26 PM

I guess you could do something like this:
Say you have to lists of equal dimensions, List1 and List2

To compare them, check the maximum difference between any to adjacent cells. like this

If max(abs(List1-List2)) = 0 <- They are equal

#8 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 08 December 2003 - 09:34 PM

but that wont work if the list contains a string will it?

#9 BiTwhise

BiTwhise

    Casio Overgod

  • [Legends]
  • PipPipPipPipPipPipPip
  • 627 posts
  • Gender:Male
  • Location:Guildford, Surry, UK
  • Interests:Programming, games, consoles, martial arts

  • Calculators:
    FX9700WE, CFX9970G, AFX2.0, Classpad 300

Posted 08 December 2003 - 10:11 PM

For that you would need to use strCmp anyway.. both with list vars and normal vars.. why would you want to compare a list of strings? that's not like something you'de put in a standard library.. a bit specific don't you think?

#10 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 08 December 2003 - 10:18 PM

well, I'd like it to be able to compare any list with any data types, I've made a function that turns the list into a string then uses StrCmp to compare them, that seems to work nicely... do you think there is a need for it?

#11 BiTwhise

BiTwhise

    Casio Overgod

  • [Legends]
  • PipPipPipPipPipPipPip
  • 627 posts
  • Gender:Male
  • Location:Guildford, Surry, UK
  • Interests:Programming, games, consoles, martial arts

  • Calculators:
    FX9700WE, CFX9970G, AFX2.0, Classpad 300

Posted 08 December 2003 - 10:21 PM

Don't think there's any need for that in a standard library..
Besides, generalizing it like that would sacrifice alot of speed..

#12 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 08 December 2003 - 10:33 PM

not really, its only like 7 lines:

ExpToStr L1,L1
ExpToStr L2,L2
StrCmp L1,L2,tmp
if tmp=0
Then:retrn(1)
Else:retrn(0)
EndIf

#13 Andy.Davies

Andy.Davies

    Forum Ghost

  • [Legends]
  • PipPipPipPipPipPipPipPip
  • 1547 posts
  • Gender:Male
  • Location:Dorset, England
  • Interests:Age: 18
    Studying: MEng in cybernetics at Reading uni
    Interests: Progaming (VB, VB.Net, C#, Casio Basic)
    Computers UBBD (Using, Building, Breaking &amp; Destroying)
    Gaming (FPS, RTS, RPG)
    Electronics
    Rock Music (Preferably Loud)
    Riley's (Pool &amp; Snooker Bar)
    Driving (Preferably fast)
    Aikedo (Martial Art)

  • Calculators:
    Algebra FX 2.0 ROM 1.01, FX9750G

Posted 08 December 2003 - 11:07 PM

erm, im no expert, but why not make 2 librarys? one standard and one advanced?

#14 BiTwhise

BiTwhise

    Casio Overgod

  • [Legends]
  • PipPipPipPipPipPipPip
  • 627 posts
  • Gender:Male
  • Location:Guildford, Surry, UK
  • Interests:Programming, games, consoles, martial arts

  • Calculators:
    FX9700WE, CFX9970G, AFX2.0, Classpad 300

Posted 08 December 2003 - 11:10 PM

The number of lines don't really tell you much about performance..

Anyways, in this case I guess you're right, the difference isn't very big, and with small numbers (that is, numbers with few digits) the StrCmp version would actually execute faster.

#15 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 08 December 2003 - 11:17 PM

hmm... I dont understand why the size of the number would matter... after all, it makes the entire list (not each cell) a string so {1,2,3} becomes "{1,2,3}". why is {1,100} diffrent in speed from {1,2,3}?

#16 BiTwhise

BiTwhise

    Casio Overgod

  • [Legends]
  • PipPipPipPipPipPipPip
  • 627 posts
  • Gender:Male
  • Location:Guildford, Surry, UK
  • Interests:Programming, games, consoles, martial arts

  • Calculators:
    FX9700WE, CFX9970G, AFX2.0, Classpad 300

Posted 08 December 2003 - 11:19 PM

the longer the strings to compare, the slower the comparison...

#17 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 08 December 2003 - 11:28 PM

:blink: yeah, but why does a longer list differ from longer numbers?

#18 BiTwhise

BiTwhise

    Casio Overgod

  • [Legends]
  • PipPipPipPipPipPipPip
  • 627 posts
  • Gender:Male
  • Location:Guildford, Surry, UK
  • Interests:Programming, games, consoles, martial arts

  • Calculators:
    FX9700WE, CFX9970G, AFX2.0, Classpad 300

Posted 08 December 2003 - 11:40 PM

huh..what?

it doesn't... it's the total length of the resulting string that could potentially make the comparison longer..

it's just, if you have high precision number I think the numerical comparison might actually be faster than the string (since the string would be very long) approach.. then again, it's hard to tell with the abstraction of such a high level language

#19 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 09 December 2003 - 12:09 AM

:unsure: ok, it sounded like you were saying they were diffrent...

andy: I think its best to have just one library, after all, unless casio starts including the library pre-installed with each new classpad people will have to download it off my site. if we have multiple librarys (and especially if they refrence each other) people will have to hunt down each library on the net to run their progs. plus, the standard library is just a collection of usefull programs, functions, and variables that can aid programmers, its not limited to any one type of programming and can even be utilized outside of programs.

#20 Andy.Davies

Andy.Davies

    Forum Ghost

  • [Legends]
  • PipPipPipPipPipPipPipPip
  • 1547 posts
  • Gender:Male
  • Location:Dorset, England
  • Interests:Age: 18
    Studying: MEng in cybernetics at Reading uni
    Interests: Progaming (VB, VB.Net, C#, Casio Basic)
    Computers UBBD (Using, Building, Breaking &amp; Destroying)
    Gaming (FPS, RTS, RPG)
    Electronics
    Rock Music (Preferably Loud)
    Riley's (Pool &amp; Snooker Bar)
    Driving (Preferably fast)
    Aikedo (Martial Art)

  • Calculators:
    Algebra FX 2.0 ROM 1.01, FX9750G

Posted 09 December 2003 - 09:55 AM

yeah ok, your right im wrong :lol:

#21 XF007

XF007

    Casio Fan

  • Members
  • PipPip
  • 45 posts

  • Calculators:
    ClassPad 300

Posted 09 December 2003 - 04:13 PM

2 Programs (i have no free usb :x)
Ceil (to round up)
int(nb)=>n
If n>=nb
Then
Print n
Else
Print n+1
IfEnd

Floor (to round down)
int(nb)=>n
If n>=nb
Then
Print n-1
Else
Print n
IfEnd

I will probably do this :
explode
str_replace

#22 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 09 December 2003 - 06:34 PM

ok, I'm going to change them a bit to to use retrn() instead of print.

on another note I'm making a function that can determine the length of text (in pixels), I'll also make a justify program that will format the text justified left, right, or center.

#23 BiTwhise

BiTwhise

    Casio Overgod

  • [Legends]
  • PipPipPipPipPipPipPip
  • 627 posts
  • Gender:Male
  • Location:Guildford, Surry, UK
  • Interests:Programming, games, consoles, martial arts

  • Calculators:
    FX9700WE, CFX9970G, AFX2.0, Classpad 300

Posted 09 December 2003 - 07:11 PM

There's already a floor function in the calc.. only it's called intg()

a ceil function could look something like this:

ceil(n) = piecewise(frac(n),intg(n)+1,n)

#24 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 09 December 2003 - 07:21 PM

hmm... I might do that instead, that way I can make it a math function.

#25 BiTwhise

BiTwhise

    Casio Overgod

  • [Legends]
  • PipPipPipPipPipPipPip
  • 627 posts
  • Gender:Male
  • Location:Guildford, Surry, UK
  • Interests:Programming, games, consoles, martial arts

  • Calculators:
    FX9700WE, CFX9970G, AFX2.0, Classpad 300

Posted 09 December 2003 - 07:30 PM

Here's a suggestion for a rounding function that rounds up or down to a given number of decimal positions

round(x,n) = int(abs(x)*10^n+0.5)/10^n*signum(x)

where
x := the variable to round
n := number of decimal positions

--- EDIT ---
You might want to include a test for x=0, since signum(0) would return undefined..
A new function could look like this:

round(x,n) = piecewise(x,int(abs(x)*10^n+.5)/10^n*signum(x),x)

#26 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 09 December 2003 - 07:34 PM

ooo.. thats nice, I'll use that for sure :)

#27 XF007

XF007

    Casio Fan

  • Members
  • PipPip
  • 45 posts

  • Calculators:
    ClassPad 300

Posted 09 December 2003 - 08:01 PM

i learn things every days ;)

#28 BiTwhise

BiTwhise

    Casio Overgod

  • [Legends]
  • PipPipPipPipPipPipPip
  • 627 posts
  • Gender:Male
  • Location:Guildford, Surry, UK
  • Interests:Programming, games, consoles, martial arts

  • Calculators:
    FX9700WE, CFX9970G, AFX2.0, Classpad 300

Posted 09 December 2003 - 08:07 PM

We all do :)

PS: A small edit on my previous post

#29 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 09 December 2003 - 08:38 PM

ok, I've added your function and two of my own:

penx(x):
this takes input in the form of an X variable gotten by GetPen, it moves it over bye -6 (putting it closer to the actuall pen)
sentax: penx(x)=>x

peny(y):
same as above but for Y, moves it by -36
sentax: peny(y)=>y

I'm considering making all the keycode variables functions so they cant be changed accedentily by progs, what do you think?

#30 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 09 December 2003 - 10:27 PM

I guess I should explain the screen program: first, its not done, thats why I havent mentioned it... second, I acedentally included it in the last release (if i dont finish it before the next one I'll remove it). third, it is meant to position the screen how you want it, easy enough to do by itself but it will also be able to enforce the graph screen to be maximised.

how to figgure out if te graph screen is maximised:
1) do Cls
2) do pxlon 5,5
3) store a picture
4) ask user to resize the screen
5) Cls
6) recall your picture
7) do plxtest 5,5
if the answer is 1 then the screen has not been resized

#31 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 10 December 2003 - 03:16 PM

I just compleated the tlen() and center() functions:

tlen(STR str): return type: RTN
returns the length of the text in pixels ("A"=6), currently supports anything you can find on the main keyboard.

center(STR str): return type: NONE
prints centered text on the screen (text window). uses tlen()

#32 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 12 December 2003 - 08:34 PM

ok, good news and bad:
Bad: i lost the most recent update of the library (right before sending it to my pc :cry: )

Good: I remember how to make most of it so I dont think there will be any great loss (except of time). also (at overlords request) I made two new functions:

encrypt(ALL data, INT key): return: RTN
Encrypts data (stores as string), allows for multiple layers of encryption :D

decrypt(STR data, INT key): return: RTN
Decrypts incrypted data.

example:
encrypt("hi",5) = ":'mn'"
encrypt(":'mn'",10) = ";:,D1wx1,"
decrypt(";:,D1wx1,", 10) = ":'mn'"
decrypt(":'mn'", 5) = "hi"

I'm sure you could figgure it out, but it should do.

#33 Andy.Davies

Andy.Davies

    Forum Ghost

  • [Legends]
  • PipPipPipPipPipPipPipPip
  • 1547 posts
  • Gender:Male
  • Location:Dorset, England
  • Interests:Age: 18
    Studying: MEng in cybernetics at Reading uni
    Interests: Progaming (VB, VB.Net, C#, Casio Basic)
    Computers UBBD (Using, Building, Breaking &amp; Destroying)
    Gaming (FPS, RTS, RPG)
    Electronics
    Rock Music (Preferably Loud)
    Riley's (Pool &amp; Snooker Bar)
    Driving (Preferably fast)
    Aikedo (Martial Art)

  • Calculators:
    Algebra FX 2.0 ROM 1.01, FX9750G

Posted 13 December 2003 - 12:18 PM

your making me want a classpad! (not a bad thing) also, i wish this library would work on the AFX, the functions you have put in so far will be very useful.

#34 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 29 December 2003 - 05:21 PM

ok, here is a full list of all compleat (or very nearly compleat) programs and functions in the library at this time, I hope to add more in the next few days but here is what I have right now: (new ones have a description)

programs:
checkver
error
isdef
lcmp- compares two lists, if equal returns 1, else 0.
lsrem- removes a cell from a list which contains strings.
polyline
printf
printl
require
retrn
sins- inserts a string or number into a string (ex sins("Money: $ US", 9,10 or "10") returns "Money: $10 US")
srem- removes any number of characters from a string.
stdlib
textf
tmenu- creates a simple text menu with printl, then waits for a selection.
waitkey
waitpen

functions:
lins- inserts a list into an existing list at any point
lrem- removes a cell from a list that has no strings (same as lsrem, but cant do strings for unknown reasons...)
round

functions not working properly:
these dont work because of a bug in strToExp, as soon as its fixed they will function properly.
encrypt
decrypt
mpush
mpop

the next beta will be uploaded tomorrow, around 6pm my time, any submisions for this release must be in by then. I may have a few more by then too, I have quite a plane ride tomorrow :)

#35 betoe

betoe

    UCF Spanish Translator

  • [Legends]
  • PipPipPipPipPipPipPip
  • 846 posts
  • Gender:Male
  • Location:Guadalajara/Mazatlan, Mexico.
  • Interests:Electronics, SW development, automotive. Swim->bike->run

  • Calculators:
    Algebra FX2.0 (R.I.P.), Classpad 300

Posted 30 December 2003 - 03:11 AM

I'm too interested on watch the code of waitkey and waitpen, maybe it could help me to make some program.

#36 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 30 December 2003 - 05:07 AM

you can get them on my site, they were part of the last release.

#37 betoe

betoe

    UCF Spanish Translator

  • [Legends]
  • PipPipPipPipPipPipPip
  • 846 posts
  • Gender:Male
  • Location:Guadalajara/Mazatlan, Mexico.
  • Interests:Electronics, SW development, automotive. Swim->bike->run

  • Calculators:
    Algebra FX2.0 (R.I.P.), Classpad 300

Posted 30 December 2003 - 10:09 PM

I download it. Nice functions crimson, i will try to use it for make faster my convertion program, its too slow when the user input a hex number. It would be so nice if we can use keyboard buffer interruptions or other interruptions in the CP programamtion.

#38 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 31 December 2003 - 03:43 AM

ok, its officially up, its still a beta release but we are very close to a first fully functional version.

I've included encrypt and decrypt in the release, but be aware that there may be problems. also included is the program script which is an improved version of the scripting language I was using in the RPG and will replace the RPG's version once compleated (it much faster).

an interesting thing to think of: making level files into scripts, then encrypting them so they cant be edited, then decrypting when run.

btw: its better to use multiple levels of encryption (encrypt the encrypted text a few times :greengrin: )

#39 Overlord

Overlord

    Casio Technician

  • Moderator
  • PipPipPipPipPipPip
  • 355 posts
  • Gender:Male
  • Location:Brussels - Belgium
  • Interests:Math Researcher

  • Calculators:
    My head - C300 OS 3.00 - G100 Rom 1.02 - G65 - G60 - G25

Posted 01 January 2004 - 03:43 PM

tlen and center have disappeared ?

#40 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 01 January 2004 - 04:00 PM

yeah, they were lost when my calc reset. I can remake them but it will take a while. (I litterally have to measure every letter)


2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users