The Perl and Raku Conference 2023 in Toronto
Attending this event?
Back To Schedule
Wednesday, July 12 • 4:00pm - 4:50pm
The N-Queens problem by Regexp.

Sign up or log in to save this to your schedule, view media, leave feedback and see who's attending!

A long string of alternating White and Black Queens, and a single Regular Expression is you need to solve the N-Queens problem!

NOTE: This talk will not be recorded.

A staple for new Computer Science students and a favourite topic for interview questions is to write a program to solve the N-Queens problem: find a way to place N Queens on an NxN chess board such that no two Queens attack each other.

This is what we are going to do in this talk, but our language of choice is going to be the language of regular expressions.

Once we’re done with just placing Queens, we will expand the problem and use regular expressions to place multiple, different pieces on the board, in such a way no two pieces attack each other.

Master this technique, and leave a lasting expression during your next job interview.


Wednesday July 12, 2023 4:00pm - 4:50pm EDT
Track 1

Attendees (7)