(thread title was: "contest: first screen capture = 500 karma points!")
titty
Here is "titty" (tiny tty - display tiny text on eink display, in a retro "artistic statement" fashion):

click image to see the script
tangle
UPDATE: This thread now has a new script called "tangle" that gives Kindle 3 (Keyboard) owners some "triangle fun":

click image to see the script
rippleweave
Here is "rippleweave" (for kindle 4 and touch) that generates 3D function plot images like this:

click image to see the script
Here is PoP's backport of rippleweave for the Kindle 3:
https://www.mobileread.com/forums/sho....php?p=2011822
spoxbrane
Contest rules:
Run the "spoxbrane" script to completion (about 15 minutes), then make a screen capture and post the image here. If you are the first poster, you win 500 mobileread karma points.
UPDATE: I gave 500 karma points to varnie for the first posted screenshots. I also gave 500 karma points to thomass for the first screenshot of the completed picture.
I will not post my own screen capture until later. I want you to be surprised at what "develops" on the touch or K4 eink screen when you run the "spoxbrane" script.
spoxbrane 1.0c:Spoiler:
PHP Code:
#!/bin/sh
####################################
# spoxbrane - algorithmic art script
# version 1.0c by geekmaster
# Copyright (C) 2012 geekmaster
# MIT License: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
####################################
#===================================
# spoxbrane - eink moire pattern art
#-----------------------------------
spoxbrane() {
local i j r
eips -c -f # flash clear
eips 19 18 "Spoxbrane 1.0c"; sleep 2
eips 19 20 "by Geekmaster"; sleep 4
eips -c -f # flash clear
i=100; while [[ $i -gt 0 ]];do
i=$((i-1)); j=$((150-i)); r=$((i*2+1))
circle $HX+35 $HY $r; line $((i*4)) 0 $MX $((i*16/3))
circle $HX $HY+90 $r; line $MX $((i*16/3)) $((j*4)) $MY
circle $HX-35 $HY $r; line $((j*4)) $MY 0 $((j*16/3))
circle $HX $HY-90 $r; line 0 $((j*16/3)) $((i*4)) 0
done; line $MX 0 $MX $MY; line $MX $MY 0 $MY
}
#===========================
# initvar - init global vars
#---------------------------
initvar() {
DZ=/dev/zero DN=/dev/null DF=/dev/fb0 MX=599 MY=799 HX=300 HY=400
set $(eips -i|grep line_length); VX=$4
}
#==================================
# line - Bresenham's line algorithm
# usage: line x0 y0 x y
#----------------------------------
line() {
local x0=$1 y0=$2 x=$3 y=$4; local dx dy sx sy e e2
if [[ $x -gt $x0 ]];then dx=$((x-x0));sx=1; else dx=$((x0-x));sx=-1;fi
if [[ $y -gt $y0 ]];then dy=$((y0-y));sy=1; else dy=$((y-y0));sy=-1;fi
e=$((dx+dy)); dd if=$DZ of=$DF bs=1 count=1 seek=$((y*VX+x)) 2>$DN
while [[ $x0 -ne $x || $y0 -ne $y ]];do
dd if=$DZ of=$DF bs=1 count=1 seek=$((y0*VX+x0)) 2>$DN
e2=$((e+e))
if [[ $e2 -gt $dy ]];then e=$((e+dy));x0=$((x0+sx));fi
if [[ $e2 -lt $dx ]];then e=$((e+dx));y0=$((y0+sy));fi
done; eips '' # update display
}
#===================================
# circle - midpoint circle algorithm
# usage: circle cx cy r
#-----------------------------------
circle() {
local cx=$1 cy=$2 r=$3; local e=$((-r)) x=$r y=0
while [[ $x -ge $y ]];do
dd if=$DZ of=$DF bs=1 count=1 seek=$(((cy+y)*VX+cx+x))
dd if=$DZ of=$DF bs=1 count=1 seek=$(((cy+y)*VX+cx-x))
dd if=$DZ of=$DF bs=1 count=1 seek=$(((cy-y)*VX+cx+x))
dd if=$DZ of=$DF bs=1 count=1 seek=$(((cy-y)*VX+cx-x))
dd if=$DZ of=$DF bs=1 count=1 seek=$(((cy+x)*VX+cx+y))
dd if=$DZ of=$DF bs=1 count=1 seek=$(((cy+x)*VX+cx-y))
dd if=$DZ of=$DF bs=1 count=1 seek=$(((cy-x)*VX+cx+y))
dd if=$DZ of=$DF bs=1 count=1 seek=$(((cy-x)*VX+cx-y))
e=$((e+2*y+1)); y=$((y+1))
if [[ $e -ge 0 ]];then e=$((e-2*x-1));x=$((x-1));fi
done 2>$DN; eips '' # update display
}
initvar # init global vars
spoxbrane # eink moire pattern art
The "spoxbrane" script (click "Show" in above Spoiler tag) takes about 15 minutes to run to completion on my touch (booted from main), or 13 minutes on my K4 (booted from diags). It runs when booted from main or diags, and it can run from a RUNME.sh script (loaded by data.tar.gz), or from an SSH command line (in main or diags).
It is completely safe (other than consuming your time while you watch it run). As you can see in the code above, it ONLY writes to
/dev/fb0 (the eink framebuffer device).
There is less interference from the kindle desktop framework when booted from the main system partition if you tap the power button to start screensaver mode before starting this script from SSH.
You can save the final results with "
dd if=/dev/fb0 of=/mnt/us/spoxbrane.raw", then convert that to a
600x800 8-bit grayscale PNG file with IrfanView for Windows, or the Gimp or other favorite app in linux.
Post it here, and if you are the first poster, you get 500 karma points.
Feel free to modify the script to generate different "algorithmic art" pictures, and post those here too.
Enjoy!
UPDATE: Here is the *real* original post that started this series of scripts:
https://www.mobileread.com/forums/sho....php?p=1997659
P.S. This was developed to go with my touchscreen support code, for buttons and onscreen keyboard (all done in /bin/sh script with minimal dependencies on other programs). This is a bit slower than it would be in C, but I think it is cool that it can even be done at all this way. It is an elegant and clever hack, IMHO.
EDIT: I made small cosmetic improvements to the code above and in spoxbrane.gz below, but they are functionally identical to the original code first posted here, so no need to download it again. I also removed unused residual "touchscreen support" code.
You can download spoxbrane.gz (v1.0c) below: