notebook.py import%20marimo%0A%0A__generated_with%20%3D%20%220.11.8%22%0Aapp%20%3D%20marimo.App(width%3D%22full%22%2C%20app_title%3D%22%22%2C%20css_file%3D%22%22)%0A%0A%0A%40app.cell%0Adef%20_()%3A%0A%20%20%20%20%22%22%22%0A%20%20%20%20Export%20to%20WASM-powered%20HTML%3A%0A%20%20%20%20%20%20%20%20uv%20run%20marimo%20export%20html-wasm%20notebook.py%20-o%20.%20--mode%20run%0A%0A%20%20%20%20Serve%20locally%3A%0A%20%20%20%20%20%20%20%20uv%20run%20-m%20http.server%20--directory%20.%0A%20%20%20%20%22%22%22%0A%0A%20%20%20%20import%20marimo%20as%20mo%0A%0A%20%20%20%20with%20mo.status.spinner(%22loading%20snakes%20on%20a%20browser...%22)%3A%0A%20%20%20%20%20%20%20%20%23%20import%20micropip%0A%20%20%20%20%20%20%20%20%23%20await%20micropip.install('requests')%0A%20%20%20%20%20%20%20%20import%20requests%0A%0A%20%20%20%20%23%20get%20and%20set%20login%20name%20from%20query%20param%0A%20%20%20%20%23%20if%20_no_%20login%20param%2C%20then%20login%20is%20eidorb%0A%20%20%20%20%23%20otherwise%20login%20is%20set%20to%20login%20param%0A%20%20%20%20%23%20if%20login%20param%20_present_%20but%20empty%2C%0A%20%20%20%20%23%20app%20will%20be%20in%20an%20%22uninitialised%22%20state%0A%20%20%20%20query_params%20%3D%20mo.query_params()%0A%20%20%20%20login%20%3D%20mo.ui.text(%0A%20%20%20%20%20%20%20%20value%3D%22eidorb%22%0A%20%20%20%20%20%20%20%20if%20query_params%5B%22login%22%5D%20is%20None%20%20%23%0A%20%20%20%20%20%20%20%20else%20query_params%5B%22login%22%5D%2C%0A%20%20%20%20%20%20%20%20on_change%3Dlambda%20value%3A%20query_params.set(%22login%22%2C%20value)%2C%0A%20%20%20%20)%0A%20%20%20%20return%20login%2C%20mo%2C%20query_params%2C%20requests%0A%0A%0A%40app.cell%0Adef%20_(avatar_url%2C%20login%2C%20mo%2C%20query_params)%3A%0A%20%20%20%20from%20urllib.parse%20import%20urlencode%0A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20f%22%22%22%0A%20%20%20%20%20%20%20%20%2F%2F%2F%20details%20%7C%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20mo.image(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20avatar_url%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20width%3D123%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20rounded%3DTrue%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20caption%3Df%22%7Blogin.value%7D's%20projects%22%20if%20login.value%20else%20None%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20).center()%0A%20%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%20%20This%20webpage%20is%20interactive!%0A%0A%20%20%20%20%20%20%20%20Enter%20your%20GitHub%20login%3A%20%7Blogin%7D%0A%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%2F%20admonition%20%7C%20Come%20again%0A%0A%20%20%20%20%20%20%20%20%20%20Changing%20the%20login%20updates%20this%20page's%20URL.%0A%20%20%20%20%20%20%20%20%20%20Use%20it%20to%20come%20back%20to%20the%20same%20state%3A%0A%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20mo.ui.text(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20f%22%7Bstr(mo.notebook_location())%7D%3F%7Burlencode(query_params.to_dict())%7D%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20full_width%3DTrue%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%2F%0A%20%20%20%20%20%20%20%20%2F%2F%2F%0A%20%20%20%20%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%20(urlencode%2C)%0A%0A%0A%40app.cell%0Adef%20_(login%2C%20mo%2C%20requests)%3A%0A%20%20%20%20import%20itertools%0A%0A%20%20%20%20%23%20fall%20back%20to%20placeholder%20avatar%20and%20empty%20list%20of%20repos%0A%20%20%20%20%23%20if%20user%20can't%20be%20found%0A%20%20%20%20user%20%3D%20None%0A%20%20%20%20%23%20brute%20search%20for%20interesting%20identicons...%20-%20https%3A%2F%2Fgithub.com%2Fkashav%2Fidenticon%0A%20%20%20%20avatar_url%20%3D%20%22https%3A%2F%2Fgithub.com%2Fidenticons%2Fjsime.png%22%0A%20%20%20%20repos%20%3D%20%5B%5D%0A%0A%20%20%20%20%23%20try%20to%20look%20up%20avatar%20and%20repos%20from%20user%20login%0A%20%20%20%20try%3A%0A%20%20%20%20%20%20%20%20with%20mo.status.spinner()%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20response%20%3D%20requests.get(f%22https%3A%2F%2Fapi.github.com%2Fusers%2F%7Blogin.value%7D%22)%0A%20%20%20%20%20%20%20%20%20%20%20%20response.raise_for_status()%0A%20%20%20%20%20%20%20%20%20%20%20%20user%20%3D%20response.json()%0A%20%20%20%20%20%20%20%20%20%20%20%20repos%20%3D%20requests.get(user%5B%22repos_url%22%5D).json()%0A%20%20%20%20%20%20%20%20%20%20%20%20%23%20avatar_url%20%3D%20f%22https%3A%2F%2Fgithub.com%2Fidenticons%2F%7Blogin.value%7D.png%22%0A%20%20%20%20%20%20%20%20%20%20%20%20avatar_url%20%3D%20user%5B%22avatar_url%22%5D%0A%20%20%20%20except%20requests.HTTPError%3A%0A%20%20%20%20%20%20%20%20%23%20api%20error%20%3A(%20fall%20back%20to%20defaults%20above%0A%20%20%20%20%20%20%20%20%23%20404%20user%20not%20found%0A%20%20%20%20%20%20%20%20%23%20403%20rate%20limited%0A%20%20%20%20%20%20%20%20pass%0A%0A%20%20%20%20%23%20style%20projects%20with%20cycling%20colours%20(details%20types)%0A%20%20%20%20types%20%3D%20itertools.cycle(%5B%22info%22%2C%20%22warn%22%2C%20%22danger%22%2C%20%22success%22%5D)%0A%20%20%20%20for%20repo%20in%20repos%3A%0A%20%20%20%20%20%20%20%20%23%20filter%20out%20forks%20and%20repos%20without%20homepages%0A%20%20%20%20%20%20%20%20if%20not%20repo%5B%22fork%22%5D%20and%20repo%5B%22homepage%22%5D%20and%20repo%5B%22name%22%5D%20!%3D%20%22eidorb.github.io%22%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20mo.output.append(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20f%22%22%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%2F%20details%20%7C%20%5B%7Brepo%5B%22name%22%5D%7D%5D(%7Brepo%5B%22homepage%22%5D%7D)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20%7Bnext(types)%7D%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7Brepo%5B%22description%22%5D%7D%20%5B%3A%3Aline-md%3Agithub-loop%3A%3A%5D(%7Brepo%5B%22html_url%22%5D%7D)%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%22%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20%20%20%20%20)%0A%20%20%20%20return%20avatar_url%2C%20itertools%2C%20repo%2C%20repos%2C%20response%2C%20types%2C%20user%0A%0A%0A%40app.cell%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20r%22%22%22%0A%20%20%20%20%20%20%20%20%3C!--%20%0A%20%20%20%20%20%20%20%20%23%23%20wot%20is%20a%20game%3F%0A%0A%20%20%20%20%20%20%20%20A%20**game**%20is%20like%20a%20computer%20program%20or%20system%20with%20rules%20and%20a%20state%2C%20such%20as%20Mario%20collecting%20stars%20or%20a%20gunfire%20rate%20in%20a%20shooter.%20%0A%0A%20%20%20%20%20%20%20%20These%20rules%20and%20states%20are%20part%20of%20what%20we%20call%20the%20**game%20model**%2C%20which%20is%20the%20underlying%20structure%20defining%20how%20the%20game%20works.%20%0A%0A%20%20%20%20%20%20%20%20**Gameplay**%20is%20the%20experience%20of%20playing%2C%20%0A%0A%20%20%20%20%20%20%20%20while%20**gameplay%20mechanics**%20are%20the%20specific%20rules%2C%20like%20how%20fast%20you%20can%20shoot%20or%20how%20energy%20depletes.%20%0A%0A%20%20%20%20%20%20%20%20The%20**game%20resource%20model**%20manages%20things%20like%20health%20or%20energy%2C%20detailing%20how%20they're%20used%20or%20replenished.%0A%20%20%20%20%20%20%20%20--%3E%0A%20%20%20%20%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20r%22%22%22%0A%20%20%20%20%20%20%20%20%23%23%20MODGE%0A%0A%20%20%20%20%20%20%20%20%3E%20%20The%20game%20is%20out%20there%2C%20and%20it's%20either%20play%20or%20get%20played.%0A%20%20%20%20%20%20%20%20%3E%0A%20%20%20%20%20%20%20%20%3E%20%E2%80%94Omar%20Little%0A%0A%20%20%20%20%20%20%20%20GitHub%20runs%20a%20multiplayer%20online%20distributed%20game%20engine%20service%20%E2%80%94%20_MODGE_.%0A%0A%20%20%20%20%20%20%20%20Games%20are%20played%20by%20billions%20of%20simultaneous%20games%20globally.%0A%20%20%20%20%20%20%20%20Not%20all%20players%20realise%20they%20are%20playing.%0A%0A%20%20%20%20%20%20%20%20It's%20odd%20for%20sure%2C%20but%20kinda%20cool!%20%0A%0A%20%20%20%20%20%20%20%20%3E%20%20A%20man%20got%20to%20have%20a%20code.%0A%20%20%20%20%20%20%20%20%3E%0A%20%20%20%20%20%20%20%20%3E%20%E2%80%94Omar%20Little%0A%0A%20%20%20%20%20%20%20%20The%20%22game%20model%22%20(underlying%20structure%20defining%20how%20the%20game%20works)%20is%20GitHub's%20REST%20API.%20%0A%20%20%20%20%20%20%20%20_How_%20it%20works%20cannot%20be%20influenced.%0A%20%20%20%20%20%20%20%20It%20simply%20exists.%0A%20%20%20%20%20%20%20%20But%20you%20can%20_use_%20it.%0A%0A%20%20%20%20%20%20%20%20API%20use%20is%20subject%20to%20rate%20limits.%0A%20%20%20%20%20%20%20%20This%20can%20be%20used%20as%20a%20rate-limited%20game%20resource%20model.%0A%20%20%20%20%20%20%20%20Various%20gameplay%20mechanics%20can%20be%20built%20upon%20this%3A%20energy%20level%2C%20stars%2C%20action%20cool%20down%2C%20etc.%0A%0A%20%20%20%20%20%20%20%20Game%20ideas%20are%20limited%20by%20imagination.%0A%0A%20%20%20%20%20%20%20%20%23%23%23%20Games%0A%0A%0A%20%20%20%20%20%20%20%20-%20%5BDeadman%5D(https%3A%2F%2Feidorb.github.io%2Fdeadman.html)%0A%20%20%20%20%20%20%20%20-%20%5BBlockwork%5D(https%3A%2F%2Feidorb.github.io%2Fblockwork.html)%0A%20%20%20%20%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%3Csmall%3EHack%20on%20your%20own%20copy%20of%20this%20notebook%20%5Bhere%5D(https%3A%2F%2Fmarimo.app%2Fhttps%3A%2F%2Feidorb.github.io%2Fnotebook.py).%3C%2Fsmall%3E%22%22%22)%0A%20%20%20%20return%0A%0A%0Aif%20__name__%20%3D%3D%20%22__main__%22%3A%0A%20%20%20%20app.run()%0A