Today’s exercise was the Difference of Squares – the sum of numbers between 1 and max squared minus the sum of each number squared between 1 and the max. The tricky part was they wanted you to use LINQ as[…]↓ Read the rest of this entry…
Posts Tagged #100DaysOfCode
My code for today’s exercise Meetup (schedule a meetup based on week of month and day of week) wasn’t particularly great. I probably could have figured out which day with some modulus arithmetic but I just iterated over the seven[…]↓ Read the rest of this entry…
Today’s exercise was to compute a scrabble score. I put the different letter values in a Dictionary, someone else used a switch case. Mine was easier to map into a LINQ query but the switch/case is probably better overall. Four[…]↓ Read the rest of this entry…
Todays exercise was to validate a phone number for correctness and return the number as digits only. This is a perfect place to use a regular expression. Years ago I would have been too timid to use them. I probably[…]↓ Read the rest of this entry…
Today’s exercise was the Collatz Conjecture. I remember the Coding Train doing a cool video on this. It has a nice visualization. I decided to also do my own visualization using python and turtle graphics (plus a Perlin Noise background[…]↓ Read the rest of this entry…
Today’s exercise was Perfect Numbers. If the sum of the factors of a number is equal to the number it is perfect. Less than and Greater than are either deficient or abundant. I have been promising myself I would make[…]↓ Read the rest of this entry…
Another secret requirement in the exercise Grains. I am supposed to throw an ArgumentOutOfRange if the value passed in is not between 1 and 64. Maybe put that in the problem description. I shouldn’t stumble across it in the tests[…]↓ Read the rest of this entry…
I did it again, one line of code to complete the exercise Acronym which takes a sentence and makes an acronym out of it. That one should be in the easy category, not medium. For the 2048 game I improved[…]↓ Read the rest of this entry…
Today’s exercise was Isogram (a word with no repeating letters). Since everyone was showing off their higher-order and LINQ stuff yesterday I decided to see if I could do it in just that too. Here it is. Other solutions were[…]↓ Read the rest of this entry…
Today’s exercise was Pangram (a sentence that includes all of the letters of the alphabet). I thought my solution was small but everyone else did it in a single line of linq code. Bunch of show-offs. Why do we play[…]↓ Read the rest of this entry…





