Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
Here's a version that supports decimal points and gives a fixed-length output:

:If A<0
:If C=D
Yay for the Weregoose! That looks great, is about the same size, and is simpler with more features.
After I meandered to TI|BD, I saw a complaint as to round( 's inability to look past the ninth digit. Now, with N as the argument, we have:


Edit: While this routine keeps N digits, round( seems to base its calculation on the location of the decimal point. I'll grant mine similar behavior when I'm feeling up to it.
SirCmpwn wrote:
Number to String Alternative
The LinReg method is nice and well optimized, but has the downside of destroying the graph screen. Here's a version that doesn't. For small numbers, it's also faster.

That's a nice routine. Pity that I can't use it for one of my programs because I'm dealing with 8 digit numbers.
Weregoose, fascinating, I wonder why round() has that limitation. If you want to bug me about it one day, I'd love to dive into the OS and try to figure it out. Very Happy
In my document processor, fishbot suggested I implement an auto-wordwrap feature, so here's a fragment of code that I believe I'm going to use for it. Basic string pixel width, for the small text( character set:
Inputs: Str1 is the string you're trying to find the width of
Str2 is a list of all the characters you will be using
L1 is a list of the width of all the characters you will be using, required to be in the same order as Str2.

Outputs: width of str1 stored to Ans


I think that that is most useful when you provide the list and string that you need for the widths, no? Smile That's excellent, though, and I'd be happy to generate that if you don't have it handy.


This will give a modular value of A/B.
EDIT: Didn't knew it already had one XP
Hehe, not a problem. I hope that you'll continue adding contributions to this thread, though!
Binary-Reflected Gray Code
Ans = Binary list (e.g., {1,0,1,0,1,0} for 42 = 1010102)
Ans = Gray code equivalent

Good thinking there, Weregoose! It's been a while since I've thought about gray coding. Smile
Carrying over from this topic...

Bitwise Operations
C = Gaussian integer (
L1 = 2^{0,1,2,...,n} (specify number of bits)
Ans = Decimal integer resulting from the bitwise operation on (




From what I gather, this deals with unsigned integers only.

Replace abs( with not( for NOR/NAND/XNOR.


:DelVar CDelVar B
:If B<91 and "^"≠sub(Str1,A,1 //(the “^” is to know when you want to wrap the text. But any other symbol is fine too)
:If " "≠sub(Str1,A,1
:B+5→B //(5 or 6 is fine, 5 is kinda squishy)
:If A<length(Str1)-1
:Ans-2(" "≠sub(Str1,A,1→B
:DelVar B
:C+7→C //(6 or 7, if you have lots of text 6 is better but 7 is easier to read)

This works for me! Very Happy
0rac343, could you give us some more information about what that routine is for and what inputs and outputs it has? I don't think it's relevant to the post directly above it, so it could use some clarification.
Recommended window settings:

:Zoom In

Die Pip Plotter
X = Integer from one through six
Drawing of corresponding die

:Input X
:If fPart(.5X

Five-Die Plotter
Ans = Five-element list of integers from one through six
Drawing of corresponding dice, displayed side-by-side

:Input L1
:If fPart(.5L1(I+3
As always, Weregoose, you absolutely blow me away. Nice work.
Linear Equation/Inequality Solver
Str1 = First-order, univariate statement involving X and one relational operator
Reduced statement with X isolated to the LHS

:Disp "X"+sub(Str2,sum(seq(expr(Str1),X,Ans-1,Ans+1){4,2,1}),1

Example: (-X-3)/9≥-5 returns X≤42 – see that the relation will switch sides if necessary.
Sierpinski Triangle
Inputs: None
Outputs: IFS-generated Sierpinski sieve fractal

:Repeat 0

Other functions to try:

:-.5(Ans+e^(.5iπint(3rand //Xmin=-1, Xmax=1, Ymin=-2/3, Ymax=1/3
:.5(Ansi+e^(.5iπint(3rand //Xmin=-1, Xmax=3/4, Ymin=-1/2, Ymax=√(3)/2
:.5(1+Anse^(.5iπint(3rand //Xmin=0, Xmax=1, Ymin=-1/4, Ymax=1/2
Oh, wow, you never cease to amaze me...
Congrats !

Edit : I'd recommend, for the first code, something like :
Xmin = -1, Xmax = 1.1, Ymin = -.2, Ymax = 1
No points can ever be drawn outside of -1≤x≤1 and 0≤y≤1 for the first function.
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
» Goto page Previous  1, 2, 3 ... 8, 9, 10, 11, 12, 13  Next
» View previous topic :: View next topic  
Page 9 of 13
» All times are GMT - 5 Hours
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum