Differences

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

Link to this comparison view

Both sides previous revision Previous revision
fp2025:hw3 [2026/05/02 10:53]
silviu
fp2025:hw3 [2026/05/02 10:58] (current)
silviu
Line 103: Line 103:
 **11.** Implement a function ''​sequences'',​ that returns a map of the form: ''​(5,​a),​ (4,b), (3,c), (2,​d)''​ where: **11.** Implement a function ''​sequences'',​ that returns a map of the form: ''​(5,​a),​ (4,b), (3,c), (2,​d)''​ where:
   * ''​a''​ is the number sequences of length 5 that the player has established (on lines, columns or diagonals).   * ''​a''​ is the number sequences of length 5 that the player has established (on lines, columns or diagonals).
-  * ''​b''​ is the number of sequences of length 4 **which can be filled-out in order to achieve a 5-sequence**. For example: ''​XX.XX''​ is such a sequence for player ''​One'',​ however ''​XX0XX''​ is not, since this cannot be filled-out in order to achieve a 5-sequence.+  * ''​b''​ is the number of sequences of length 4 **which can be filled-out in order to achieve a 5-sequence**. For example: ''​XX.XX''​ is such a sequence for player ''​One'',​ however ''​XX0XX''​ is not, since this cannot be filled-out in order to achieve a 5-sequence. Also, in instances where you have ''​..XXX.''​ you have two ways to complete the row with two additional positions filled resulting in ''​.XXXX''​ and ''​XXXX.''​.
   * ''​c''​ (resp. ''​d''​) is the number of sequences of length 3 (resp. 2) which can be filled-out in order to achieve a 5-sequence.   * ''​c''​ (resp. ''​d''​) is the number of sequences of length 3 (resp. 2) which can be filled-out in order to achieve a 5-sequence.