{"id":19413445,"url":"https://github.com/wisehackermonkey/falling_sand","last_synced_at":"2025-10-03T19:25:39.115Z","repository":{"id":250236051,"uuid":"833877516","full_name":"wisehackermonkey/falling_sand","owner":"wisehackermonkey","description":"Another Falling Sand Game","archived":false,"fork":false,"pushed_at":"2024-07-26T06:36:18.000Z","size":1611,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-03T21:35:00.611Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://editor.p5js.org/wisemonkey/sketches/d07oVs7Ws","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wisehackermonkey.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-26T00:30:35.000Z","updated_at":"2024-08-15T04:43:33.000Z","dependencies_parsed_at":"2024-11-10T12:34:03.702Z","dependency_job_id":"4d1b9525-7e9d-47fb-9e6a-5b33939ff8da","html_url":"https://github.com/wisehackermonkey/falling_sand","commit_stats":null,"previous_names":["wisehackermonkey/falling_sand"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/wisehackermonkey/falling_sand","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wisehackermonkey%2Ffalling_sand","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wisehackermonkey%2Ffalling_sand/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wisehackermonkey%2Ffalling_sand/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wisehackermonkey%2Ffalling_sand/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wisehackermonkey","download_url":"https://codeload.github.com/wisehackermonkey/falling_sand/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wisehackermonkey%2Ffalling_sand/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260453717,"owners_count":23011573,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T12:33:05.827Z","updated_at":"2025-10-03T19:25:39.027Z","avatar_url":"https://github.com/wisehackermonkey.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# falling sand\ninspired by https://www.youtube.com/watch?v=ArcHpsTXhb0\nAnother Falling Sand Game\n# [Demo! click here](https://editor.p5js.org/wisemonkey/sketches/d07oVs7Ws)\n\nhttps://github.com/wisehackermonkey/falling_sand\ncreator wisehackermonkey\n20240725\n\n\n\nfound a cool recusive algrotim that speeds up drawing 100x*\nalso looks cool to boot!\n\n#  CONTROLS\n# + = make bigger  (key is actually \"=\")\n#  - = make smaller \n# SPACE = reset\n\n\ninspired by amazing video \nAnother Falling Sand Game\nby \nTimidAutomaton \nhttps://www.youtube.com/watch?v=ArcHpsTXhb0\n\n\n\n*idk real numbers are hard.\n\nhttp://localhost:5555/#/falling_sand\n![alt text](image.png)\n![alt text](image-4.png)\nfirst working verions!!!\n![alt text](image-1.png)\n# first working piling behavor\n![](image-3.png)\n# prompt\n```python\nwrite a javscript p5.js sketch.\ncreates two grid's\ngrid_current = a NxN arrays, (hiegnt, width),initalized to all 0 's\ngrid_buffer = a NxN arrays, (hiegnt, width), initalized to all 0's\ncreate a enum {0: empty, 1: sand}\nset current position to \nwhere height defaults to 10\n      width  defaults to 10\n\ncreate a function updateGridState to screen\ninputs: \ngrid_buffer, grid_current\n\nfor each row in grid\n\niterate the columns\nif grid[current row+1][current column] is equal to enum \"empty\"\n    set grid_buffer [current row][current column] to 'empty'\n    # move the sand pixel down \n    set grid_buffer [current_rowrow+1][current column] to \"sand\"\nif  cell bellow current is sand and grid to left \u0026 down is 'EMPTY'\n    set left and down = SAND\n    set current index to EMPTY\n\n\n\nreturns buffer grid\n\ncreate a function draw_pixels\n\ninputs: \nscale factor for pixels default to 4x size, grid\nfor each position in grid draw a rect of size scale factor by scale factor\nset fill color to sandstone yellow\nreturn \n\ncreate a function that sets the current mouse position mapped to which current grid location its pointed to and sets it from EMPTY to full\nalso set the surounding pixels in a radius of 5 to SAND\n\nfunciton draw()\nset the result of updateGridState(scale factor, grid_buffer, grid_current) to current grid\ndraw_pixels\n```\n\nprompt v1\ndraw_pixels\ncreate a edge detection kernal if the sum of the kernal detects a edge add a vertext to beginshape\nif not dont do anything\n\n\n![alt text](image-5.png)\nDUDE THIS LOOKS AWESOME\nbut has error of vertex drawing order\n![alt text](image-6.png)\n\nfixed! was simple\ndam this one came out looking really cool\nprompt v2\ndraw_pixels\nrecusively do\nstart by splitting the grid into 4 quadrents test each, keep sub dividing untill box test size is 1\nset call limit to 10\n\nbox test is iterate through \nif 0 is found then box test fails\n    recurvivly subdivide the box \nif all are 1's then pass\n    add vertex's for all 4 corners of.\n\n\n![alt text](image-7.png)\nlooks cool by color by call depth\n\n\n![alt text](image-8.png)\n\ncreate eraser\ncreate water    \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwisehackermonkey%2Ffalling_sand","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwisehackermonkey%2Ffalling_sand","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwisehackermonkey%2Ffalling_sand/lists"}