Pac-Man in < 512 Bytes of HTML and JavaScript
HTML
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENSE.txt
README.md
annotated.html
index.html
package.json
pacman.gif

README.md

Pac-Man in 348 Bytes of HTML+JS

Based on the the oldskool remake by @maettig of the classic arcade game Pac-Man. Golfed down by @aemkei, @p01, @subzey, @xem, @0ndras, @maettig. See the original gist.

Demo

PLAY THE DEMO!

Use your keyboard to control the movement.

Source

<body onload=for(l=D=11;d=k=D--;x=78)l+="῿
၁᝝ᐅᗕᔕᕵ".charCodeAt(D<7?D:10-D).toString(2)
+3;l=l.split(""),setInterval("if(x^X)for(h
=i=l[x]=2,l[x+=d=2%k||9&l[x+(o=k%2||~-k*14
)]?9&l[x+d]?0:d:o]=4,l[X]&=7,b=D%4-2,b=b++
%2||b*14,9&l[X+b]?D++:X+=b,l[X]|=8;i<154;)
p.innerHTML=h+='.# \\nx'[l[++i]]||0",X=151
) onkeydown=k=event.which-38><pre id=p>

Gameplay Video

Pac-Man

Board Layout

#############
#     #    .#       #   = Wall
# ### # ###.#
# # X    .#.#       X   = Ghost
# # # ###.#.#
# # # o #.#.#       o   = Player
# # ### #.#.#
# # ......#.#       .   = Gold
# ### #.###.#
#.....#.....#
#############