2017-09-18

Battleship and homework review.

We discussed problem 7 from the homework. You should finish it based on the discussion.

Mentioned from Chapter 5: type to make short ways to say types. Examples:

    type Pt = (Int,Int)
    type Ship = [Pt]
    type Shots = [Pt]

We wrote the function is_sunk for battleship.

Functions we discussed:

  • [&&]: Join two Boolean values with logical and.
  • and: Join a list of Boolean values with logical and.
  • all: Apply a tester function and then join all of the values together with “and”.

All of these functions have counterparts for logical or; they are: ||, or, any.

Last modified August 18, 2023: 2022-2023 End State (7352e87)