Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - nemo

Pages: 1 ... 53 54 [55] 56 57 ... 82
811
TI-BASIC / Re: Circle Graphs
« on: September 02, 2010, 09:34:23 pm »
thanks meishe! i'll be sure to post here once i tell her about it. speaking about that, i'm not sure if i should just show her the source code or disguise it as AsmPrgm:3E7FD306CD2845. (WARNING: BrandonW's OSKill. do NOT run that program.) pros: i'm a legend for using the OSKill on a teacher. cons: i'm gonna be in huge trouble for invalidating my teacher's OS under the guise of a pie charting program.

meishe, it took me about 10 minutes of coding but about a half hour of pondering in math, lol

812
Axe / Re: Floating Point in Axe
« on: September 02, 2010, 09:28:21 pm »
so i was thinking about making my own "floating point data type" if you will. it'll probably be more of a tutorial on how one might manage floating point numbers if one wants. it would probably not use mantissa-exponent notation, as although it's very fast, it's expensive on memory. instead i was thinking of having a sign bit, then 12 bits for the integer part and 11 bits for the floating part. this would allow your maximum number to be 4095.2047. i know, it's small. i was thinking of having them be stored as four bytes, making the highest number 65535.32767, which i think is more reasonable since you get 4 digits in the floating point guaranteed, and a pretty high number as your integer part. this would allow for some basic floating point in axe. (quadratic solver anyone?) unless this is a feature quigibo plans to put in the final release and i'm just blabbing about floating point for nothing.
That would actually be fixed-point (cause the decimal point is in a fixed position)

so i would have to use mantissa-exponent notation, or something similar for it to be floating point? is there an advantage to floating point?

raylin, i don't think there is. i mean there are 9 byte floats that are organized by the OS, but there's no way to multiply, add, subtract or divide them in an axe program. i'm just asking if attempting to make this sort of system is a good idea, and then have subroutines to add/subtract/multiply/divide.

i'm just wondering if it's worth the effort or if anyone would use them.

813
Axe / Floating Point in Axe
« on: September 02, 2010, 09:17:59 pm »
so i was thinking about making my own "floating point data type" if you will. it'll probably be more of a tutorial on how one might manage floating point numbers if one wants. it would probably not use mantissa-exponent notation, as although it's very fast, it's expensive on memory. instead i was thinking of having a sign bit, then 12 bits for the integer part and 11 bits for the floating part. this would allow your maximum number to be 4095.2047. i know, it's small. i was thinking of having them be stored as four bytes, making the highest number 65535.32767, which i think is more reasonable since you get 4 digits in the floating point guaranteed, and a pretty high number as your integer part. this would allow for some basic floating point in axe. (quadratic solver anyone?) unless this is a feature quigibo plans to put in the final release and i'm just blabbing about floating point for nothing.

814
Miscellaneous / Re: Pet Peeves-Post Here
« on: September 02, 2010, 09:17:23 pm »
@tloz128
I completely agree with number four. I hate/d that :( I mean why mark us points down for being smart?

it's also one of my pet peeves, but it does make sense. what if someone didn't study, peeked over at his classmate's answers and just copied them down without work?

815
TI-BASIC / Re: Circle Graphs
« on: September 02, 2010, 08:38:49 pm »
i haven't shown it to her yet. she thinks she's a calculator guru because she can store to variables and use the Rcl function. she once Rcl'd a variable... i was thinking my head why not just type the variable name? but yeah i plan on showing her it tomorrow
thanks apcalc!

816
TI-BASIC / Circle Graphs
« on: September 02, 2010, 08:27:50 pm »
My Functions, Statistics and Trigonometry (FST) teacher said you couldn't graph a pie chart on your calculator. i took this as a challenge, and as a result:

Code: [Select]
ZStandard
84->Xmin
72->Ymax
ZInteger
Degree
SortA(L1
Delvar ADelvar Bdim(L1->dim(L2
Circle(47,31,25,{i
For(Z,1,dim(L1
360L1(Z)/sum(L1->A
Ans+B->B
Line(47,31,47+25sin(Ans),31+25cos(Ans
round(fPart(A/360),3->L2(Z
End

L1 contains your initial data. it's going to be sorted so you can read the circle graph. your data in L1 is displayed starting at the very top of the circle going around clockwise. L2 contains your percentages, rounded to the thousandths. the sorting isn't really necessary, i just like it.

edit: this reminds me.. it's time for me to remake my graphical triangle solver to incorporate the ambiguous case. i'm sure it could use some optimization.

817
Axe / Re: Should this work or am I being stupid?
« on: September 01, 2010, 06:36:41 pm »
Code: [Select]
:.INIT
:"appvRPGSave"->Str1
:Data(100,7,7,0,1,1,1,1,121)->GDB1
:GetCalc(Str1,9)->A
:Copy(GDB1,A,9
:Archive Str1

818
Axe / Re: Bitmap command
« on: August 30, 2010, 06:12:57 pm »
Code: (General Formula) [Select]
Data(rowsInImage , columnsInImage)->Pic1  .columnsInImage must be a multiple of eight!
[[HEX]]
Bitmap(X,Y,Pic1)

819
Axe / Re: Axe-Storing Hex to string
« on: August 29, 2010, 08:37:16 pm »
I assume it would be done like this, though i haven't tested it.

Code: [Select]
"0123456789ABCDEF"->Str1
GetCalc("prgmASM")->P  .P is a pointer to the start of the data of the program ASM
GetCalc("Str1",{P-2}^r*2)->S   .S is a pointer to the start of the data of OS var Str1
For(Z,0,{P-2}^r-1
{{P+Z}->A/16+Str1}->{Z*2+S}
{A^16+Str1}->{Z*2+1+S}
End

know that i'm not 100% sure this will work.. it should probably be tested on an emulator first. i tested it on a few basic programs though, which came with seemingly correct results. with a basic program having only 01234 as its first line, my program gave me the string 3031323334, which are the ASCII character codes of 0-4.

edit: this didn't work for an asm program i had. it might be better just to give the asm program an axe header, use axe's back-up feature to make an appvar of the program. then you have it in an appvar for your use.

820
[OTcalc] Z80-Hardware / Re: [OTZ80] [Poll] Wifi or no wifi?
« on: August 29, 2010, 01:09:21 am »
Wifi would not only ban the calculator on sat and act tests, but also from school in general. Wifi is a type of radio signal, like a cell phone. Making any device intended for school with wifi defeats the purpose. This shouldn't even be a question

821
TI-BASIC / Hex to Sprite
« on: August 25, 2010, 10:44:41 pm »
it's memory consuming, and takes up your variables A-F, but for BASIC it's fast. your sprite data is in Str1.
Code: [Select]
10->A:11->B:12->C
13->D:14->E:15->F
For(Z,0,15
8fPart(Z/2->G
iPart(Z/2->H
expr(sub(Str1,Z+1,1
If Ans>7
Pxl-Change(H,G
If (Ans>3 and Ans<8) or Ans>11
Pxl-Change(H,G=1
If (Ans>1 and Ans<4) or (Ans>9 and Ans<12) or Ans=6 or Ans=7 or Ans>13
Pxl-Change(H,G+2
If fPart(Ans/2
Pxl-Change(H,G+3
End

to make it faster, you can change all the If's to If-Then-End's.

i also made a routine for octal data, where your sprite size is 9x8, since the data fitting into a byte isn't very important in basic. i think the following would work:
Code: [Select]
For(Z,0,23
int(9fPart(Z/3->A
iPart(Z/3->B
expr(sub(Str1,Z+1,1
If Ans>3
Pxl-Change(B,A
If Ans=2 or Ans=3 or Ans=6 or Ans=7
Pxl-Change(B,A+1
If fPart(Ans/2
Pxl-Change(B,A+2
End

but that code gives me a domain error on pxl-change, even when B and A are definitely in-bounds..




822
TI-BASIC / Re: Run-Length Encoding for Strings
« on: August 25, 2010, 09:54:08 pm »
i don't follow how you store your data, but ok. good luck with your routines, i hope to see them (:

823
TI-BASIC / Re: Run-Length Encoding for Strings
« on: August 25, 2010, 09:39:52 pm »
np meishe. yeah, the slowdown is probably due to u being solved each time. but i never aim for speed in a compression routine, since compression routines aren't likely to be used in games, just the corresponding decompression routine.

i'm thinking your data loss is due to the limit issue i have with your code. make your first 11 characters in the string your trying to compress the same tile number, and then compress the string. see if you get a matching beginning sequence after decompressing the compressed string.
i'm thinking that the string "111111111111" 12 1's, will compress to "121" which will then give an error during decompression.

made a few more changes, added in my limit idea (i still think it's a good idea):
Code: [Select]
DelVar BDelvar A"_→Str3
Str1+Ans→Str1
"sub(Str1,B+1,1→u   
Repeat u="     
Repeat A=9 or u≠sub(Str1,B+A+1,1
A+1→A
End
Str3+sub("0123456789",A+1,1)+u→Str3      .must be in this order
B+A→B
Delvar AEnd
sub(Str3,2,length(Str3)-1→Str3

if you want to have your strings be compressed where the highest run can be greater than ten,  you can easily substitute A=9 for a higher number, and add onto the sub("0123456789") command. for example, to expand it to 13 you would have A=12 and sub("0123456789ABCD",A+1,1), but your decompression routine would have to be modified to allow that.

824
TI-BASIC / Re: Run-Length Encoding for Strings
« on: August 25, 2010, 08:30:53 pm »
just changed a few minor things.

Code: [Select]
"_→Str3
Str1+Ans→Str1
"sub(Str1,B+1,1→u    .[2nd]+[7] u, not the lowercase one.
{0,1→L1
DelVar B1→A
Repeat u="     .again, the equation variable u. one space.
Repeat u≠sub(Str1,B+A,1
A+1→A
End
{0,A-1→L2
LinReg(ax+b) Y1
Equ►String(Y1,Str4
Str3+sub(Str4,1,length(Str4)-3)+u→Str3      .must be in this order
B+A-1→B
1→A
End
sub(Str3,2,length(Str3)-1→Str3

i'm not 100% sure all the changes are made are valid, since i don't have any strings to compress into RLE and only tested things on the homescreen. something you might want to consider is to initialize A as 0 instead of one. for one, this allows you to use DelVar. secondly, statements like B+A-1→B and {0,A-1→L2 become B+A→B and {0,A→L2, saving a few bytes. also, one thing to consider is a limit. since one character can only hold numbers 0-9, what if someone in their string has 13 2's in a row? your compressed string would show 132, but the decompression routine would read it as 1 tile #3, and then 2 of the next tile #.

825
TI-BASIC / Re: Run-Length Encoding for Strings
« on: August 25, 2010, 06:33:17 pm »
oops. my bad, i thought there was only one of those commands.

Pages: 1 ... 53 54 [55] 56 57 ... 82