User Tools

Site Tools


cs326:daily3

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
cs326:daily3 [2018/01/28 23:05]
scarl
cs326:daily3 [2021/09/06 13:47] (current)
scarl
Line 1: Line 1:
 ==== CSci 326: Daily 3 ==== ==== CSci 326: Daily 3 ====
 +
 +Record your results from Part 1 and the results of running tests from Part 2 on paper and turn in at the beginning of the next class. You can turn in a printout of the code for Part 2, or just email it. 
  
 **Part 1.**  The following pattern matches use basic collection types. Make a table with two columns: in the first column **guess** if the match succeeds or fails, and what the value of each variable will be if it succeeds. In the second column, show the actual result and bindings you get when you run these in **iex**. **Part 1.**  The following pattern matches use basic collection types. Make a table with two columns: in the first column **guess** if the match succeeds or fails, and what the value of each variable will be if it succeeds. In the second column, show the actual result and bindings you get when you run these in **iex**.
Line 16: Line 18:
   - ''​[a,​ b, c | tail]  = [1, 2, 3, 4, 5, 6]''​   - ''​[a,​ b, c | tail]  = [1, 2, 3, 4, 5, 6]''​
  
 +**Note**: if you copy/paste these, the double-quote character won't copy correctly, giving unexpected errors. Type the double-quote directly from the keyboard.
  
 **Part 2.** You saw the tuple data type in Daily 1. There are two built-in functions for accessing tuple elements and creating new tuples from existing ones: **Part 2.** You saw the tuple data type in Daily 1. There are two built-in functions for accessing tuple elements and creating new tuples from existing ones:
cs326/daily3.1517202354.txt.gz ยท Last modified: 2018/01/28 23:05 by scarl