http://www.smilebasicsource.com/page?pid=143
So I made this thread to talk about DEFY.
I want to bring up something I have been programming, and is almost done, which is TOPOINT().
It is meant to store two 16-bit sign and magnitude integers in a single numerical value for space conservation.
That means you can have integers between ±32767 as well as -0 which represents NaN.
It will have GETX() and GETY() to extract the numbers, and some additional commands compatible with point type.
What do you guys think?
DEFY Code Library
Root / Talk About Programs / [.]
AveryCreated:
CAP can be variable=MIN(MAX(variable,Minimum),Maximum) (at least use this in the DEF)Oh. I thought MIN and MAX only worked on arrays.
LF$() Smilebasic never uses line feedI thought it does... it works like a line break.
?"ABC"+LF$()+"XYZ" ABC XYZHonestly, I would have expected you would go after CR$() which just puts that blue line end character you see in the source code editor.
NULL$() should be NUL$I was really debating which way would be better. If you say so, I'll change it to NUL$.
TOUCHP() should return -1 if screen is not touchedAnother thing I was considering, but here's my reason for it defaulting to 0. I find it nice being able to just put it straight into an IF statement, and have it work as testing if the screen is touched, without having to put "!=-1". And TOUCH OUT can only return X between 5-314 and y 5-234. (I have purposefully miscalibrated my touch screen to check this.) So it will not be confused with being touched in the top left corner in practice.
My suggestions: Q$() (quotation mark)Putting in a quotation mark constant is a great idea. It just shouldn't be Q$(). It's one letter, and I don't want an error when a programmer gets an error when making their own DEF Q$(). I think it should be QUOT$() or QT$().
HSVREAD Color OUT h, s, vI honestly didn't take the HSV() function seriously because I just made it out of boredom. But, it is a useful function, actually. It should have an HSVREAD OUT, but that will mean I'll have to take out the automatic dithering it does.
So I have made an incomplete 3D rendering engine I'm hoping to implement into DEFY. Here's a little demo. Public key: 4343X541
It just takes in points and polygons which connect to the points, have colors, and it also takes in the position and rotation of the camera, which you can control while the program runs.