CMU 15-112 Summer 2020: Fundamentals of Programming and Computer Science
Homework 9 (Due Tue 9-Jun, at 5:00pm)
- This assignment is SOLO. This means you may not look at other student's code or let other students look at your code for these problems. See the syllabus for details.
- To start:
- Create a folder named 'hw9'
- Download hw9.go to that folder
- Edit hw9.go using VSCode
- When you are ready, submit hw9.go to Autolab. For this hw, you may submit up to 10 times, but only your last submission counts.
- Do not use sets, dictionaries, or recursion in this assignment.
- Do not hardcode the test cases in your solutions.
- This homework may be graded for style.
- NOTE: For the next few days, assignments in Go will be manually graded. As long as you pass the test cases in the starter file you'll receive full credit during grading.
- bestScrabbleScore() [5 pts - Bonus]
In Go, write bestScrabbleScore() from hw4 with a few changes. Rather than returning a tuple, have two return values: ([]string, int) in all cases. When there are no available words, return an empty slice and zero as your score.
- isKingsTour() [5 pts - Bonus]
In Go, write isKingsTour() from collab5.
- makeMagicSquare() [5 pts - Bonus]
Write the function makeMagicSquare(n) that takes a positive odd integer n and returns an nxn magic square by following De La Loubere's Method as described here. If n is not a positive odd integer, return an empty slice.