2 //This will draw the ASCII neverending sinus curve.
3 //Writen by (c) Harvie in 2oo6
4 //This is script for PHP CLI (Not WebPage).
5 //You can port it to web by replacing "/n" by "<br>/n"
8 $start = 0; //0 //First X
9 $step = 0.1; //0.1 //Increase X on every line by this number
10 $reset = 6.2; //When X >= reset, then it will be reseted to zero
11 $zoom = 1; //1 //This will repeat every line few times
12 $sleep = "15000"; //15000 - Wait between lines in microseconds
13 $line = (" "); // " " // ":" //chr ( 176 ) //This is the string, that will be repeated from display start to the curve (curve inlay).
14 $endline = ("+\n"); // "#\n" // ".\n" //chr ( 219 )."\n" //This is the string, that will be printed at end of every line (curve outline).
17 //You can specify yours function here:
20 $offset = 1.1; //1.1 //1 //0 -> Zero offset will draw only half of sin curve.
21 $width = 35; //20 //35 //40 //This will stretch every line.
23 $y = ( (sin($x) +
$offset) * $width );
24 //echo("Debug: ".$x." ".$y." "); //Debug
30 echo ("[SinusCurve]-[c][Harvie][2oo6]\n\n");
32 echo ("-|--------------------------------------------->\n");
41 usleep($sleep); //Wait in microseconds
48 $znaku2 = round($znaku); //It looks better after round ;)
51 $znaku2 = ($znaku2 - 1);
53 //echo(" ".$pos); //Debug
56 $zoom2 = ($zoom2 - 1);
59 $pos = ($pos +
$step);
This page took 1.845158 seconds and 4 git commands to generate.