View Single Post
Old 03-18-2012, 05:06 PM   #16
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 6,433
Karma: 10773670
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
Quote:
Originally Posted by PoP View Post
Sure. In its time I liked APL too though it bit me more than once.

I just want to plead innocence and point that on my KK v3.3 (blame it on an older or perhaps buggy shell interpreter) I had to expand constructs such as
Code:
while [[ $x0 -ne $x || $y0 -ne $y ]];do
into
Code:
while [[ $x0 -ne $x ]] || [[ $y0 -ne $y ]];do
to make the script work (loop would otherwise fail with an error message).
I started with much more modern shell constructs (double-paren conditionals, etc.) and I had to apply forced regression to my code to backport it to the old busybox shell used in the kindles. This was not tested on a K3 yet, so thanks. I would probably shorten that line by changing "]] || [[" to "-o" though, which was the "old fashioned" way of dealing with compound arithmetic comparisons. Apparently even older kindle firmware versions will require even more shell feature regression.

The K3 also needs to be adjusted for 300 byte wide lines and the opposite color. This script has $MX $MY $HX and $HY vars to adjust, but you probably need to adjust other scale factors in the "draw3d" function as well.

P.S. I still have an APL option ROM for my old Centronix printer. Of course, PRINTING an APL program was generally a waste of time, because APL was considered (even by those who used it) to be a "write-only" language.

EDIT: I *do* use in-line comments in places where it aids readability. Also, I reverted to "-a" and "-o" for compound conditionals in rippleweave 1.0a in its first post (but not the .gz file yet), for K3 compatibility.

EDIT 2:
Because this reply wrapped to a new page in this thread, I wish to mention that we are discussing the "rippleweave" script that generates 3D function plot images like this:


click image to see the script

P.S. Thanks PoP for the animated GIF shown above (and on the first post)!


Last edited by geekmaster; 03-19-2012 at 02:44 PM.
geekmaster is offline   Reply With Quote