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 = -3; //0 //First X
11 $step = 0.1; //0.1 //Increase X on every line by this number
12 $reset = "0"; //When X >= reset, then it will be reseted to $resetto (use "" to disable reset).
13 $resetto = "0.1"; //$resetto
14 $zoom = 1; //1 //This will repeat every line few times
15 $sleep = "15000"; //15000 - Wait between lines in microseconds
16 $line = (" "); // " " // ":" //chr ( 176 ) //This is the string, that will be repeated from display start to the curve (curve inlay).
17 $endline = ("+\n"); // "#\n" // ".\n" //chr ( 219 )."\n" //This is the string, that will be printed at end of every line (curve outline).
20 //You can specify your function here:
23 $offset = 20; //1.1 //1 //0 -> Zero offset will draw only half of sin curve.
24 $width = 1; //20 //35 //40 //This will stretch every line.
26 $y = ( ( (3 / $x) +
$offset) * $width );
27 //echo("Debug: ".$x." ".$y." "); //Debug
33 echo ("[SinusCurve]-[c][Harvie][2oo6]\n\n");
35 echo ("-|--------------------------------------------->\n");
47 //usleep($sleep); //Wait in microseconds
54 $znaku2 = round($znaku); //It looks better after round ;)
57 $znaku2 = ($znaku2 - 1);
59 //echo(" ".$pos); //Debug
62 $zoom2 = ($zoom2 - 1);
66 //echo(" ".$pos."\n"); //Debug
68 echo("-+------------------------------------------------------------>\n");
72 $pos = ($pos +
$step);
74 //Reset (for neverending curves, etc...):
75 if ( ($pos >= $reset) && ($reset != "") ) {
79 //Stop if $stop is reached:
This page took 1.444333 seconds and 4 git commands to generate.