Skip to content

Latest commit

 

History

History
24 lines (14 loc) · 971 Bytes

2013-02-12-book-problems.md

File metadata and controls

24 lines (14 loc) · 971 Bytes

Scala

Day 1: The Castle on the Hill

  • Write a game that will take a tic-tac-toe board with X, O, and blank characters and detect the winner or whether there is a tie or no winner yet. Use classes where appropriate.

  • Bonus problem: Let two players play tic-tac-toe.


Day 2: Clipping Bushes and Other New Tricks

  • Use foldLeft to compute the total size of a list of strings.
  • Write a Censor trait with a method that will replace the curse words Shoot and Darn with Pucky and Beans alternatives. Use a map to store the curse words and their alternatives.
  • Load the curse words and alternatives from a file.

Day 3: Day 3: Cutting Through the Fluff

Do

  • Take the sizer application and add a message to count the number of links on the page.
  • Bonus problem: Make the sizer follow the links on a given page, and load them as well. For example, a sizer for “google.com” would compute the size for Google and all of the pages it links to.