1 <title
>SinusCurve
- (c
) Harvie
2oo6
</title
>
4 body
{ background
-color
: black
; color
: lime
; font
-family
: Arial
, Tahoma
; }
5 #hide { border: 2px solid; color: white; margin: 10px; padding: 10px; }
7 pre
{ line
-height
: 20%
; letter
-spacing
: 0%
; word
-spacing
: 0%
; }
9 #hide { border: none; height: 0px; overflow: hidden; color: red; }
10 body
{ background
-color
: white
; color
: black
; font
-family
: Arial
, Tahoma
;}
17 <form action
="#" method
="get">
18 <b
>Settings
:</b
><br
/><br
/>
19 X
-Min
: <input type
="text" name
="start" value
="0"> = First X
<br
/>
20 X
-Max
:<input type
="text" name
="reset" value
="<? echo(2*PI()); ?>"> = Last X
<br
/>
21 Step
: <input type
="text" name
="step" value
="0.07"> = Increase X by this every line
.<br
/><br
/>
23 Y
-Offset
: <input type
="text" name
="offset" value
="1.1"> = Displacement on
Y (0 = half sinewave
; 1.1 = whole sinewave
)<br
/>
24 Width
:<input type
="text" name
="width" value
="35"> = Y Zoom
<br
/>
25 Zoom
: <input type
="text" name
="zoom" value
="1"> = X
Zoom (Every line will be printed this much times
.)<br
/><br
/>
27 Outline
: <input type
="text" name
="outline" value
="+"> = Curve
outline (try: "#")<br
/>
28 Inlay
: <input type
="text" name
="inlay" value
=" "> = Curve
inlay (try: ":")<br
/><br
/>
33 Press CTRL
and try to roll MouseWheeeel
...<br
/>
34 Look at source code of this webpage
;)<br
/>
37 <input type
="submit" value
=".: DRAW :.">
41 //This will draw the ASCII "neverending" sinus curve.
42 //Writen by (c) Harvie in 2oo6
45 $start = 0; //0 //First X
46 $step = 0.07; //0.1 //Increase X on every line by this number
47 $reset = (2*PI()); //When X >= reset, then it will be reseted to zero
48 $zoom = 1; //1 //This will repeat every line few times
49 $offset = 1.1; //1.1 //1 //0 -> Zero offset will draw only half of sin curve.
50 $width = 35; //20 //35 //40 //This will stretch every line.
51 $sleep = "0"; //15000 - Wait between lines in microseconds
52 $line = (" "); // " " // ":" //chr ( 176 ) //This is the string, that will be repeated from display start to the curve (curve inlay).
53 $endline = ("+<br />\n"); // "#<br />\n" // ".<br />\n" //chr ( 219 )."<br />\n" //This is the string, that will be printed at end of every line (curve outline).
55 //Read settings from form:
56 if ($_GET["start"] != "") {
57 $start = $_GET["start"];}
58 if ($_GET["reset"] != "") {
59 $reset = $_GET["reset"];}
60 if ($_GET["step"] != "") {
61 $step = $_GET["step"];}
63 if ($_GET["offset"] != "") {
64 $offset = $_GET["offset"];}
65 if ($_GET["width"] != "") {
66 $width = $_GET["width"];}
67 if ($_GET["zoom"] != "") {
68 $zoom = $_GET["zoom"];}
70 if ($_GET["outline"] != "") {
71 $endline = ($_GET["outline"]."<br />\n");}
72 if ($_GET["inlay"] != "") {
73 $line = $_GET["inlay"];}
76 echo ("[SinusCurve]-[c][Harvie][2oo6]<br />\n<br />\n");
77 echo (" | y<br />\n");
78 echo ("-+-----------------------------------------------------------------------------><span id=\"sipka\">-------> Y ></span><br />\n");
80 echo (" V<br /><br />\n<small>\n");
87 //usleep($sleep); //Wait in microseconds
89 $znaku = ((sin($pos) +
$offset) * $width);
94 $znaku2 = round($znaku); //It looks better after round ;)
97 $znaku2 = ($znaku2 - 1);
99 //echo(" ".$pos); //Debug
102 $zoom2 = ($zoom2 - 1);
105 $pos = ($pos +
$step);
106 if ($pos >= $reset) {