Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (isset($_GET["base"]))
- $const = intval($_GET["base"]);
- else $const = 2;
- if (isset($_GET["brightness"]))
- $brightness = intval($_GET["brightness"]);
- else $brightness = 1500;
- ?>
- <title>col(n,<?=$const;?>)</title>
- <body bgcolor="black" style="color: white">
- <?php
- function col ($n, $b = 2) {
- return ($n % $b == 0) * ($n/$b)
- + ($n % $b > 0) * ($n+intval($n/$b)+1);
- }
- $maxi = 0;
- $array = [];
- for ($i = 1; $i < 10000; $i++) {
- $m = $i;
- while (!in_array($m,$array)) {
- $array[count($array)] = $m;
- $m = col($m,$const);
- }
- }
- foreach ($array as $i => $e) {
- print "<div style='position: absolute; left: ".(10+array_search(col($e,$const),$array)/10)
- ."; bottom: ".(10+col($e,$const)/10).";
- color: rgba(".($brightness/$e*255).",0,0,0.5)'>.</div>\n";
- }
- ?>
- <form method="get">
- Base : <input type="text" name="base" value="<?=$const;?>"><br>
- Brightness : <input type="text" name="brightness" value="<?=$brightness;?>"><br>
- <input type="submit">
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement