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

This video covers this project:

and this commit:

8d7860a Brings in a mock-up (in C) for the design

0:30 My name is Rick…
1:05 What we’re doing now… Adding a front-end (for the Terminal)
2:15 We’re using NCURSES, which helps implements TUIs (text-based user interfaces)
3:00 I didn’t want to rewrite this thing in C
3:30 My ultimate goal: to learn Swift, SwiftUI / But NCURSES is a step in the journey
4:55 I’ve implemented our basic design / “Isn’t that pretty cool!”
6:15 I did explore / go down a digression: Package Manager
8:05 You can implement multiple executables inside your package
9:00 Made ncurses-mock folder in my project / Modified Package.swift
10:15 Xcode helps you fill out the Package.swift
11:35 Source files missing… I bring them in
13:10 swift run ncurses-mock / No Target EXE in build description
14:10 I manually build an NCURSES program
15:00 swift build tries to build the C program, but it has problems finding the library
17:30 We can specify the library in Package.swift / linkerSettings
19:30 Relying on Xcode for help with this setting
21:00 CTRL-SPACE gives me help with what to use: LinkerSetting.linkedLibrary
22:00 I try to run program in Xcode / Doesn’t work
23:25 I run it with ‘swift run ncurses-mock’
25:00 Showing the code / Enlarging font in Editor APPLE+PLUS
25:50 “It’s been a while since I programmed in C…”
26:15 Looking at NCURSES functions in mock up C program
26:30 “Wow… no quick help?”
26:50 Inside ncurses header file
28:10 The numbers represent coordinates / Graph paper in Keynote
29:10 NCURSES is in (y, x) format
30:45 I’m off in the graph paper / But I just did math in my head
31:25 I’m using a label and GOTO in my program
33:00 Curses library (on GitHub)
34:00 Looking at forks of this project
35:40 commit 8d7860a
37:15 Let’s try to bring in this Curses project
38:10 Xcode is bringing in the project / “It’s doing stuff…”
38:50 We see log messages from the package import
39:30 Xcode’s hidden directories…
40:45 I’ll dig into this problem later…
41:20 I make a new executable to use this library
43:20 I can import Curses into my new Swift file
44:10 I try to write a simple Curses program
46:30 New build shows new activity but errors / Need to specify dependency
47:30 I add a new executableTarget in Package.swift
48:15 Trying new build / Fixing error
48:50 Trying new build / Compiler errors / cannot find type ‘WINDOW’ in scope
49:30 windowHandle UnsafeMutablePointer WINDOW
50:30 Trying to look at the library code

NCURSES

Swift Package Manager (documentation)

A case against the GOTO statement

Curses library (TheCoderMerlin)

Music
DivKid

Rick is Programming Playlist