mscroggs.co.uk
mscroggs.co.uk
Click here to win prizes by solving the mscroggs.co.uk puzzle Advent calendar.
Click here to win prizes by solving the mscroggs.co.uk puzzle Advent calendar.

subscribe

Blog

 2024-12-22 
I showed off and part-solved a prototype version of this puzzle with Katie Steckles in the fifteenth Finite Group livestream. You can watch a recording of this stream, and watch our future streams if you sign up to our Patreon.
I clearly haven't already made enough Christmas puzzles this year, so I've made another one. If you've used regular expressions before, head straight to mscroggs.co.uk/regexmas to try the puzzle. If you've not, read on...

What is a regular expression

Regular expressions are strings of characters that can be used in multiple programming languages to validate text. Regular expressions are usually written between two / characters. Between the slashes, characters have the following meaning:

The puzzle

My regular expression Christmas puzzle is shown below. You can either solve it on this page or at mscroggs.co.uk/regexmas using the buttons or your keyboard, or you can download this PDF of the puzzle.
In the grid below, write r, g, b, c, m, y, k, or w in every square so that:
The squares containing an r will be coloured red, those containing a g will be coloured green, those containing a b will be coloured blue, those containing a c will be coloured cyan, those containing an m will be coloured magenta, those containing a y will be coloured yellow, those containing a k will be coloured black, and those containing a w will be left white.
r g b c m y k w
/^w+yw+$/
/^([kw]+)[^kw]\1$/
/^(g|wwwg|gww)+.$/
/^wy?g*y+w+$/
/^((w|gg)(ww|g)){3}$/
/^[wg](w|g)[gw](.)\2+\1{2}$/
/^.g*[^y]$/
/^([gk][gk][gk])\1\1$/
/^yw+kw+y$/
/^w*b(bb)+w*$/
/^(w+)w?(bb?)\2\2\1$/
/^(www|bbb)+$/
/^w+gyw+$/
/^[wg]*y[wg]*$/
/^.*gwg.*gwb.*$/
/^[^g]+g+[^g]+$/
/^y?g+y?g+k?b+$/
/^[w]+g*w[^w]+$/
/^w+g+wg+[^g]+$/
/^w*yw*g+w*$/
/^w*y?g?y?w*$/
                        
(Click on one of these icons to react to this blog post)

You might also enjoy...

Comments

Comments in green were written by me. Comments in blue were not written by me.
 Add a Comment 


I will only use your email address to reply to your comment (if a reply is needed).

Allowed HTML tags: <br> <a> <small> <b> <i> <s> <sup> <sub> <u> <spoiler> <ul> <ol> <li> <logo>
To prove you are not a spam bot, please type "cosine" in the box below (case sensitive):

Archive

Show me a random blog post
 2024 

Dec 2024

A regular expression Christmas puzzle
Christmas card 2024

Nov 2024

Christmas (2024) is coming!

Feb 2024

Zines, pt. 2

Jan 2024

Christmas (2023) is over
 2023 
▼ show ▼
 2022 
▼ show ▼
 2021 
▼ show ▼
 2020 
▼ show ▼
 2019 
▼ show ▼
 2018 
▼ show ▼
 2017 
▼ show ▼
 2016 
▼ show ▼
 2015 
▼ show ▼
 2014 
▼ show ▼
 2013 
▼ show ▼
 2012 
▼ show ▼

Tags

folding tube maps games world cup wool sobolev spaces crossnumber computational complexity 24 hour maths convergence pac-man sport curvature crochet phd cross stitch graph theory python javascript chalkdust magazine asteroids tennis books realhats arithmetic golden spiral pizza cutting hexapawn gerry anderson sorting the aperiodical pythagoras quadrilaterals matt parker edinburgh pi hannah fry geogebra probability martin gardner countdown go oeis reuleaux polygons signorini conditions php wave scattering correlation pascal's triangle mean rhombicuboctahedron news chebyshev youtube mathslogicbot preconditioning recursion standard deviation matrices menace hats logic dataset turtles frobel reddit royal baby sound football manchester science festival error bars machine learning matrix multiplication map projections talking maths in public matrix of minors gaussian elimination squares data visualisation london underground platonic solids coins boundary element methods flexagons misleading statistics finite element method trigonometry braiding interpolation royal institution fence posts datasaurus dozen big internet math-off numerical analysis approximation inverse matrices determinants video games cambridge bubble bobble finite group estimation fractals matrix of cofactors logo stirling numbers game of life logs a gamut of games weak imposition inline code bots dinosaurs chess manchester light live stream rugby harriss spiral binary weather station hyperbolic surfaces bempp accuracy runge's phenomenon craft ucl simultaneous equations draughts propositional calculus dates statistics european cup newcastle speed databet geometry puzzles exponential growth graphs game show probability polynomials national lottery ternary golden ratio electromagnetic field plastic ratio pi approximation day christmas mathsteroids noughts and crosses stickers final fantasy gather town fonts numbers dragon curves christmas card people maths programming tmip nine men's morris captain scarlet london bodmas data regular expressions advent calendar guest posts zines mathsjam errors radio 4 folding paper latex raspberry pi palindromes anscombe's quartet triangles

Archive

Show me a random blog post
▼ show ▼
© Matthew Scroggs 2012–2024