Can you fit a whole game into a QR code?

MattKC2 minutes read

QR codes can store game code similarly to storage mediums like floppy disks and CDs, with binary data limited by standardized sizes. Compression technology like Crinkler significantly reduces program size, allowing for smaller files without compromising functionality.

Insights

  • QR codes can store binary data, not just ASCII text, limited by standardized sizes, with version 40 holding 2,953 bytes, showcasing their versatility beyond simple text storage.
  • Compression technology like Crinkler significantly reduces program size, akin to the Auto-Tune of the demoscene, enabling smaller file sizes without sacrificing functionality, emphasizing the importance of optimizing data storage in innovative ways.

Get key ideas from YouTube videos. It’s free

Recent questions

  • What type of data can QR codes store?

    QR codes can store binary data, not just ASCII text, with a maximum capacity of 2,953 bytes in version 40.

Related videos

Summary

00:00

"QR Codes: Storing Games in Tiny Sizes"

  • QR codes can store game code entirely, similar to other storage mediums like floppy disks or CDs.
  • QR codes can store binary data, not just ASCII text, limited by standardized sizes, with version 40 holding 2,953 bytes.
  • A sound from Windows 10 is 11 KB, while a 3.5" floppy disk can store 1.44 MB, almost 500 QR codes worth of data.
  • Simple code can be economical in size, with games fitting into small storage spaces like floppy disks or Atari 2600 cartridges.
  • Tetris is avoided due to legal concerns, opting for Snake as the game to implement on a QR code.
  • A Windows app is chosen over a smartphone app for QR code compatibility, with the game coded in HTML and JavaScript initially.
  • Writing in x86 assembly is explored to reduce file size, with a Win32 API window program created within 2.5 KB.
  • Byte alignment issues are faced, leading to a switch to MSVC for better control over file size, reducing it to 2.66 KB.
  • Compression through executable packing with Crinkler significantly reduces the Snake program size from 3.1 KB to under 1.4 KB.
  • The use of compression technology like Crinkler is likened to the Auto-Tune of the demoscene, allowing for smaller file sizes without compromising functionality.

13:05

Creating and Decoding QR Codes in Unix

  • QR code creation using Unix command line utilities like qrencode and ZBar
  • qrencode converts binary data into QR codes, ensuring data is specified as binary
  • ZBar is used to decode QR codes, with zbarimg for images and zbarcam for webcams
  • Issue arises with line endings in the executable retrieved from the QR code, causing a segmentation fault
  • Fixing the line ending issue by setting zbarcam's output to binary mode successfully decodes the executable
Channel avatarChannel avatarChannel avatarChannel avatarChannel avatar

Try it yourself — It’s free.