Draw my Code

Rate it

Read the day's tiny C function and paint its output on an 8x8 grid.

Every day: One new C function a day, int f(int x, int y), with an empty 8x8 grid to paint from its output; the past week's puzzles stay open and keep your streak. New puzzle: Midnight, your local time.

Play Draw my Code on lone-bee.itch.io

Draw my Code on itch.ioDraw my Code on its own site

Draw my Code puzzle #164: a C function above an empty 8x8 grid and a palette of eight numbered colours

Draw my Code gives you one short C function a day and an empty 8x8 grid. Work out what the function returns for every cell, a number from 0 to 7, and paint the cell in that number's colour; you have three attempts and only learn how many cells are wrong. It is free in the browser, with streaks and a spoiler-free result grid to share.

About Draw my Code

Draw my Code is a small daily puzzle by Lone Bee, playable on itch.io and on its own site, drawmycode.lonebee.games. Each puzzle is a single function, int f(int x, int y), where x is the column and y the row of an 8x8 grid, both running from 0 to 7. The function returns a number from 0 to 7, and each number has a colour.

Your job is to read the code and paint the picture it draws. You get three attempts, and after each one the game only tells you how many cells are wrong, not which. Some days the function is a one-line max or sum; other days it leans on integer division, operator precedence, bit operations, a loop or recursion, and now and then a quirk of C such as -3 % 2 giving -1. Every puzzle is compiled with gcc and checked for undefined behaviour, so the answer is what real C returns.

A nine-level tutorial starts from zero, so anyone who knows what x / 2 means can begin. There are stats, streaks and a result grid you can share without giving the answer away, special puzzles on some holidays, and the last week of puzzles stays open if you miss a day. It works with mouse, touch or keyboard alone, and a Show digits option helps colour-blind players.

It suits programmers and students who like reading code in their head, and anyone who enjoys a short grid puzzle with a single right answer. It is free, with no account, no ads and no cookies; progress on itch.io stays in that browser, while the own site keeps streaks better and can be installed on a phone.

How to play Draw my Code

  1. Read the day's function, int f(int x, int y); x is the column and y the row, both 0 to 7.
  2. Work out what the function returns for a cell and pick that colour, or press 0 to 7.
  3. Click or drag to paint cells; the arrow keys and Space work too.
  4. Submit when the grid is full; the game tells you how many cells are wrong.
  5. Fix the grid and submit again; you have three attempts in all.

Screenshots

A Draw my Code grid half painted in white, orange, green and purple under the day's function, with one attempt used
A solved Draw my Code grid with streak stats and a Share button

Tips

  • Look for symmetry or a pattern first: many functions paint stripes, diamonds or blocks that repeat across rows.
  • Watch C's rules: integer division rounds toward zero and the remainder of a negative number is negative.
  • Check operator precedence before you calculate; a missing bracket often changes the whole picture.
  • Use Show digits if colours are hard to tell apart.

Questions

When does a new Draw my Code puzzle come out?

Every day at midnight in your own time zone.

Do I need to know C?

A little helps, but a nine-level tutorial starts from zero; the game says that if you know what x / 2 means you can play.

Is it free?

Yes. It is free, with no account, no ads and no cookies.

What if I miss a day?

The past week's puzzles stay open, and solving them keeps your streak.

Ratings and reviews

No ratings yet. Be the first to rate Draw my Code.

Your rating of Draw my Code

No account needed. Reviews show once they have been checked. Privacy

More daily logic puzzles