teaching machines

Honors 304.503 Lecture -1 – Short course description

This class will unite the disciplines of creative writing, design, music, and computer science into the craft of game development. Students will cluster into small 4- or 5-person game development startup companies. In the fall semester these companies will design and develop some small games using Inform and the Unity game engine. They will also […]

CS 145 Lecture 13 – PrintWriter and Patterns

Agenda PrintWriter and snowpeople the so-far pattern doing a word count the fencepost pattern prompting for a valid file So-far (Cumulative) pattern We can only work on one thing at a time. When problems require processing of a set or list, we’ll have to apply the so-far pattern: Fencepost pattern Suppose we want to print […]

CS 145 Lab 7 – More on loops and conditionals

Prelab Complete Self-Check 5.28 on the Practice-It website before 8 AM on March 26. Reminder Show your completed lab 6 checkpoints to your instructor or TA in the first 20 minutes of this lab. Cards Each of today’s problems involves a deck of cards. Though we use card terminology, you do not need to have […]

CS 330 Lecture 20 – File I/O and Quiz

Agenda writing a WAV file the characteristics of imperative Code mucis.c N.B. The fwrite calls below have their middle arguments transposed. Element size comes before the number of elements. #include <stdio.h> #include <stdlib.h> #include <math.h> /* ————————————————————————- */ const int SAMPLES_PER_SECOND = 22050; const int BEATS_PER_MINUTE = 200; const float PI = 3.14159f; /* ————————————————————————- […]

CS 145 Homework 2 – due before Thursday, March 29

See the PDF.

CS 330 Homework 4 – due before Thursday, March 29

See the PDF.

CS 330 Lecture 19 – Abstracting a GUI

Agenda the libexpat API slurping a file in C adding a GUI abstraction layer using XML TODO Why we chunk-read: http://java.sun.com/developer/technicalArticles/Programming/PerfTuning/ C file I/O: http://en.wikibooks.org/wiki/A_Little_C_Primer/C_File-IO_Through_Library_Functions Code parse_xml.c #include <expat.h> #include <stdio.h> #include <stdlib.h> /* typedef parser_t * XML_Parser; */ /* ————————————————————————- */ void start(void *data, const char *tag, const char **attributes) { printf(“data: %d\n”, *((int *) data)); […]

CS 145 Lecture 12 – File I/O

Agenda program this nested loops printf reverse engineering reading from a file with Scanner writing to a file with PrintWriter TODO Read chapter 5. Reverse Engineering Code Bored.java package preexam2; public class Bored { public static void main(String[] args) { for (int r = 1; r <= 8; ++r) { for (int c = 1; […]

CS 145 Exam 1

Exam See the PDF. Results

CS 330 Lecture 18 – Callbacks and XML

Agenda we need a chairperson OpenGL game loops in GLUT hello, XML push parsing with Expat a GDB primer TODO Read the first three pages of http://www.ibm.com/developerworks/xml/tutorials/xmlintro/index.html. Code torus.c #include <stdio.h> #include <stdlib.h> #include <GL/glut.h> /* ————————————————————————- */ int x_angle = 0; int y_angle = 0; /* ————————————————————————- */ void draw_callback() { glClear(GL_COLOR_BUFFER_BIT); glLoadIdentity(); glRotatef(x_angle, 1.0f, […]

1 189 190 191 192 193 204