Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- #Oh no! I dropped my pixels on the floor and they're all muddled up! It's going to take me years to sort all 90,000 of these again :(
- #https://houseplant.riceteacatpanda.wtf/download?file_key=84f748f5ebe7c8d00c7bc50f4c71f7be0cce3be169f1cbc985d7c30d39f5b1cf&team_key=79605a1b652a12dacc5c2a56766eefe3d442b962865b4265744bc66ad2c37d22
- $arrayEntry=array(); #Image Array
- if ($handle = opendir('<DIRECTORY>')) { #open the puzzle Dir
- while (false !== ($entry = readdir($handle))) {
- if ($entry != "." && $entry != ".." && $entry != ".DS_Store") {
- array_push($arrayEntry,$entry); #put alle the images in the array
- }
- }
- closedir($handle);
- }
- ?>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.2/p5.js"> </script><!--Import p5* Library-->
- <script>
- function setup(){
- //convert PHP array into JS Array
- imageArr="<?php echo implode(",",$arrayEntry)?>" //turn the PHParray into string
- imageArr=imageArr.split(",")//turn the string into a JSarray
- var canvas = createCanvas(1000, 1000); //Create p5* canvas
- noSmooth() //remove anti-aliasing
- let i=0;//image Count
- for(let r=0;r<450;r++){//row
- for(let c=0;c<200;c++){//column
- loadImage("<DIRECTORY>/"+imageArr[i],img=>{image(img, c, r)});i++; //load the image and when ready print the image with a callback
- }
- }
- }
- </script>
Add Comment
Please, Sign In to add comment