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 = -6; //0 //First X
11 $step = 0.5; //0.1 //Increase X on every line by this number
12 $reset = 50; //When X >= reset, then it will be reseted to zero
13 $zoom = 1; //1 //This will repeat every line few times
14 $sleep = "15000"; //15000 - Wait between lines in microseconds
15 $line = (" "); // " " // ":" //chr ( 176 ) //This is the string, that will be repeated from display start to the curve (curve inlay).
16 $endline = ("+\n"); // "#\n" // ".\n" //chr ( 219 )."\n" //This is the string, that will be printed at end of every line (curve outline).
19 //You can specify your function here:
22 $offset = 1.1; //1.1 //1 //0 -> Zero offset will draw only half of sin curve.
23 $width = 2; //20 //35 //40 //This will stretch every line.
25 $y = ( ( ($x * $x) +
$offset) * $width );
26 //echo("Debug: ".$x." ".$y." "); //Debug
32 echo ("[SinusCurve]-[c][Harvie][2oo6]\n\n");
34 echo ("-|--------------------------------------------->\n");
46 //usleep($sleep); //Wait in microseconds
53 $znaku2 = round($znaku); //It looks better after round ;)
56 $znaku2 = ($znaku2 - 1);
58 //echo(" ".$pos); //Debug
61 $zoom2 = ($zoom2 - 1);
65 //echo(" ".$pos."\n"); //Debug
67 echo("-+--------------------------------------------------------------------------->\n");
71 $pos = ($pos +
$step);
73 //Reset (for neverending curves, etc...):
78 //Stop if $stop is reached:
This page took 0.828365 seconds and 4 git commands to generate.