This was inspired by Tsoder’s video https://www.youtube.com/watch?v=Qf4NyHiy0W8 where he generated all the 3×3 magic squares by brute force, generating all permutations of 1-9 and rejecting the ones which were not magic squares. My first reaction was that that was not brute force; this was brute force: This turned out to be faster than Tsoder’s method,Continue reading “Magic Square by brute force”
Author Archives: alistairjwall
FizzBuzz
FizzBuzz is a cut-down version of Eratosthenes’ sieve, which started as a drinking game and is now often used as an interview question. The rules are that you start counting, and replace numbers by Fizz if they are divisible by three, Buzz if they are divisible by five, and FizzBuzz if divisible by both. TheContinue reading “FizzBuzz”