Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
24
Task/Munching-squares/PHP/munching-squares.php
Normal file
24
Task/Munching-squares/PHP/munching-squares.php
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
header("Content-Type: image/png");
|
||||
|
||||
$w = 256;
|
||||
$h = 256;
|
||||
|
||||
$im = imagecreate($w, $h)
|
||||
or die("Cannot Initialize new GD image stream");
|
||||
|
||||
$color = array();
|
||||
for($i=0;$i<256;$i++)
|
||||
{
|
||||
array_push($color,imagecolorallocate($im,sin(($i)*(2*3.14/256))*128+128,$i/2,$i));
|
||||
}
|
||||
|
||||
for($i=0;$i<$w;$i++)
|
||||
{
|
||||
for($j=0;$j<$h;$j++)
|
||||
{
|
||||
imagesetpixel($im,$i,$j,$color[$i^$j]);
|
||||
}
|
||||
}
|
||||
|
||||
imagepng($im);
|
||||
imagedestroy($im);
|
||||
Loading…
Add table
Add a link
Reference in a new issue