teaching machines

CS 491 Lecture 13 – Persisting with Preferences

Agenda what ?s the need for persistence the need for lightweight persistence persisting in TicTacToe TODO Read http://mobile.tutsplus.com/tutorials/iphone/nsuserdefaults_iphone-sdk. Read http://www.vogella.com/articles/AndroidFileBasedPersistence/article.html. 1/4 sheet. Exercise Apps are made to be interrupted. Let’s get our hands dirty by implementing a game of TicTacToe, preserving the game state on interruption, and restoring the game from the persisted state on resume. Write […]

CS 245 Lecture 13 – Snake

Agenda what ?s exam? finish up SortedList review through Snake TODO Read section 2.5 of Data Structures. 1/4 sheet. Tasks for Snake Write Set.remove. Handle up, down, left, right cursor key events. How do we draw the snake? How do we manage the eggs? How we handle the snake moving to a spot with an […]

Everywhere Pointer

My five-year-old son wanted to make an arrow. I one-upped him by making four arrows. He liked the shape and called it an “everywhere pointer.” We can make this with the following code: This code makes me realize I should try to add the unary negation operator. Right now I have to verbosely multiply by […]

Caterpillar

If we can make 2-D art out of nothing but dots on the paper, it seems we should be able to make 3-D objects out of nothing but spheres. And we now can in Madeup. I added a dot command, such that a sphere is placed at every point the programmer visits with a move command. […]

CS 245 Lecture 12 – Generic Sorted List

Agenda what ?s what does this do? polymorphism: inheritance and parametric program this What Does This Do? Program This Code … Haiku

Recursive Objects

Madeup now supports recursion: Including the function definition in the environment of a closure tripped me up considerably, but I think I got it figured out. Or maybe I didn’t. The lattice was generated with this code: Cleaning up the corners is a job for another day.

CS 245 Lab 6 – Generics

First, if you have checkpoints left over from last lab, get them inspected during the first 15 minutes of this lab. Don’t forget to work in pairs! Where possible, please work with someone that you did not work with last week. The exchange of new ideas and perspectives is not an opportunity you want to […]

CS 491 Lecture 11 – Task Navigation

Agenda what ?s git client available navigating between Activities using intents sharing data between Android tasks navigating between tasks using UINavigationController sharing data between iOS tasks TODO Read up on UINavigationController at  http://www.appcoda.com/use-storyboards-to-build-navigation-controller-and-table-view and https://developer.apple.com/library/ios/documentation/uikit/reference/UINavigationController_Class/Reference/Reference.html. 1/4 sheet. Sharing Data Between Activities If the data is a message from one Activity to another, use Intent extras. On the […]

CS 245 Lecture 11 – Set and Generics

Agenda what ?s what does this do? writing a set data type generalizing code without a supertype What Does This Do? Code VerdeganTest.java Set.java Haiku

First-person Math

Nothing brings together the remote reaches of computer science together like writing your own programming language. My abstract syntax tree exploits inheritance and polymorphism and multiple inheritance. My parsing is done in Java while the model of the program is built up of C++ classes. I’ve got tables, stacks, and vectors. Recursion is naturally all […]

1 159 160 161 162 163 204