Learn Java in N Games
This repository contains a collection of game-based activities for learning about Java programming.
To install Learn Java in N Games, you will need:
The Java Development Kit: http://www.oracle.com/technetwork/java/javase/downloads/index.html
The Eclipse IDE for Java Developers: https://eclipse.org/downloads/
The Princeton Standard Library file stdlib.jar: http://introcs.cs.princeton.edu/java/stdlib/
Click on “Download .zip” at the top of this page. This should download a file called something like PeterDrake-ljing2-skeletons-ff35eae.zip. Move the file someplace more permanent than your downloads directory and unzip it. Rename the resulting directory ljing.
Open Eclipse. If you have never used Eclipse before, choose the default workspace and click on "Go to the workbench".
File → Import → General → Existing Projects into Workspace. Next.
In “Select root directory”, enter the path to the ljing directory you created in step 1. Many projects (starting with Anagrams) should be listed in the Projects area. Finish.
Eclipse → Preferences → Java → Build Path → Classpath Variables. New. Enter STDLIB (exactly like that) in the Name field and the path to stdlib.jar in the Path field. OK. OK.
Now expand the Shut the Box project, src, and (default package) to find ShutTheBox.java. Right-click on it and select Run As → Java Application. The game should run in the text console. If this worked, you’re good to go! (If not, please contact firstname.lastname@example.org for help.)
The Learn Java in N Games activities can be used individually or as a complete curriculum for a second course in computer science. While no specific accompanying textbook is required, Sedgewick and Wayne’s Introduction to Programming in Java: An Interdisciplinary Approach is a good choice. There are three types of activities:
Process-Oriented Guided Inquiry Learning (POGIL) activities. In these in-class activities, teams of 3-4 students learn by dissecting working game programs. See pogil.org for details. These activities have not been officially approved by the POGIL Project.
Projects. These are to be completed by pairs of students and generally require some out-of-class time. They involved creating, completing, or debugging game programs.
There are a total of 30 activities. These could be used one per day in a 10-week course that meets three times a week. In a slightly longer semester, the extra time could be used for review, additional topics, exams, and a final project.
The activities have the following order:
Shut the Box (POGIL)
Data Types, Control Structures, and Teamwork (Lecture slides)
Arrays, Comments, Graphics, and Management (Lecture slides)
Methods, Libraries, Debugging, and Information Processing (Lecture slides)
Towers of Hanoi (POGIL)
Recursion and Critical Thinking (Lecture slides)
Using Objects and Problem Solving (Lecture slides)
Text Adventure (Project)
Designing Objects, UML, and Communication (Lecture slides)
Asteroid Rally (Project)
High Scores I (POGIL)
Analysis, Searching, Sorting, and Assessment (Lecture slides)
Poker Dice (Project)
Interfaces, Stacks, and Queues (Lecture slides)
High Scores II (POGIL)
Sets, Maps, and Trees (Lecture slides)
Graphs (Lecture slides)
There is a PDF in each POGIL activity or project explaining what to do. The lecture slides are in the Learn Java in N Games Overview project.
Instructors may contact email@example.com for further information and solutions. Solutions will not be given to students.
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
This work was supported by the Google Education and Relations Fund's CS Engagement Small Grant Program grant #TFR15-00411.
The principal investigator, Peter Drake, wishes to thank the following for their useful comments: the members of the CS-POGIL project, specifically Clif Kussmaul and Helen Hu; Maggie Dreyer; and various anonymous reviewers.