Play game
Color swapper's itch.io pageHow many characters of code did you use?
555
If you're comfortable with it, paste your game code here, so we can marvel at your achievement!
<html><head><title>Swap</title><style>p{display:inline-flex;flex-wrap:wrap}a{width:33%}a.n{color:red}</style></head><body><p></p><script>let d=document;let g=d.querySelector('p');let k='n';function s(){g.innerHTML='';for(let i=0;i<9;i++){let n=Math.round(Math.random());let c=`<a onclick="cl(this)"class="${n?k:''}">O</a>`;g.innerHTML+=c;};};function cl(e){e.classList.toggle(k);let p=e.previousSibling;let n=e.nextSibling;if(p){p.classList.toggle(k);}if(n){n.classList.toggle(k);}if(!d.querySelector('.n')){alert(':)');s();}};s();</script></body></html>
Leave a comment
Log in with itch.io to leave a comment.