Rick Umali is Programming Wordle in Swift (for the command line).

This video covers this project:

and this commit

843fc66 Implements first part of algorithm / Tests

0:15 Starting…
1:05 We have to figure out how update our GuessRow
1:50 My algorithm / Let’s make a test to show you how we’ll use it
3:05 testUpdateRowCraze
4:20 GuessRow.updateRow() doesn’t exist yet
5:10 Maybe make a utility program to make the ASCII GuessRows
5:55 Test fails / The function doesn’t exist
7:20 Going into GuessRow and making updateRow() function
8:05 This function takes an argument
10:10 Test fails / But nothing was updated
11:10 Stepping through algorithm
12:30 Looking at my notes…
13:05 Coming up with algorithms… / The heart of being a programmer
13:55 If you like puzzles, or are good at math, you may be suitable for programming
14:45 Trying to teach this… is hard…
15:00 Don’t start with something difficult…
15:25 Start with something very small… like a guessing game…
16:30 Learning how problem solve, how to program, is difficult but can be learned…
17:30 Look at Leetcode for problems to solve
18:40 Leetcode has the option to submit solutions in Swift
19:05 A lot of what you do in computer science is solve problems
20:25 Oh wow… Vim mode in Xcode… That’s exciting!
21:00 This is incredible…
21:30 A little cheat-sheet for Vim mode at the bottom of Xcode
22:50 Starting to code the algorithm
23:20 We need to index our String
24:50 You can’t subscript Strings (with integers), you need String.Index
26:20 Discussion on String and String.Index / REPL
27:30 Python can index strings with subscripts / Python REPL
28:10 Python also supports ranges expressed in subscripts
29:10 We can’t do subscripts in Swift because Strings are UTF-8 (roughly)
31:00 Instead, you create a String.Index, and subscript on that
32:20 Making an String.Index with String.Index(encodedOffset:) / This is deprecated!
33:45 Deep encodedOffset post/discussion on Swift Forums
35:10 We use what compiler suggests String.Index(utf16Offset:in:)
37:05 Running test… Fails due to small bug
38:05 Running test… Now it works!
38:55 commit 843fc66

Music
DivKid

Strings

Deep discussion on String.Index on Swift Forums

Rick is Programming Playlist