N-Queens Combinatorial Problem - Polyglot FP for Fun and Profit – Haskell and Scala - Part 3
Published: Aug 22 2021
Description:
view
Slideshow:
view
All slides:
view
Download:
pdf
(for perfect image quality)
Speakerdeck:
slideshow
Slideshare:
slideshow
Scala Code:
github repo
Learn how to write FP code that displays a graphical representation of all the numerous N-Queens solutions for N=4,5,6,7,8.
See how to neatly solve the problem by exploiting its self-similarity and using a divide and conquer approach.
See how to write the equivalent Haskell program using the Gloss graphics library.
Make light work of assembling multiple images into a whole, by exploiting Doodle’s facilities for combining images using a relative layout.
See relevant FP functions, like Foldable’s intercalate and intersperse, in action.