Programming
Workshop

Spring 2014
course
navigation

tron tourney 2

I'm feeling that I haven't provided enough structure for all of you to get off the ground.
Here's some explicit instructions for csmarlboro :

how to make and run your own bot

1. Get to terminal or Git Bash shell
2. ssh to csmarlboro
$ ssh testerator@csmarlboro.org # put your username, not testerator
3. make your own copy of all the tron stuff. (notice the ".", means "here")
csmarlboro:~$ scp -r /var/www/csmarlboro/tron . csmarlboro:~$ ls -sCF 4 site/ 4 stuff/ 4 tron/ tron_logfile.txt
4. change to that directory
csmarlboro:~$ cd tron/ csmarlboro:tron$ ls -sCF 4 bots/ 4 games/ 4 lib/ 4 logs/ 8 README.md 4 run* 4 engines/ 4 index.html 4 LICENSE 4 maps/ 4 replay/ 4 tournaments/
5. make a copy of a bot
csmarlboro:tron$ ls -sCF bots/ ... bunch of stuff csmarlboro:tron$ cp bots/northbot.py bots/testerator.py # pick a name
6. edit that bot
csmarlboro:tron$ nano bots/testerator.py ... and change it. Or upload your own python code.
7. test it manually.
csmarlboro:tron$ bots/testeratory.py < bots/input.txt ...
8. watch it run against another bot by editing ./run
csmarlboro:tron$ nano run ... change which bots or which room csmarlboro:tron$ less run # show the run file ... ./engines/round.py --FPS=5 -v -B maps/empty-room.txt bots/randbot.py bots/testerator.py
9. see if it runs.
csmarlboro:tron$ ./run

debugging

I put in a lot more docs and debugging help into the github repo over the weekend, and sent you some email?
Read what's in
and see the example log stuff in
I'm guessing that we may well want to talk about how to go about debugging something that doesn't work. Anybody who writes code spends much of their time puzzling out what went wrong ... and so learning the strategies and how to play the game is a very real part of learning to program.
Volunteers to show us code that doesn't work?
Testing :
API :
Help :
Discuss stdin, stdout, redirection and all that.

algorithms

Last week I suggested that this would be our next topic.
So ...
algorithm tools:
Often there is a close connection between an algorithm and the data structures that store its calculations. Thinking about what information is needed at each step can be helpful.
Functions - breaking the task into smaller pieces ... which can mean making your own "API"
Objects / classes - assembling data & methods into nice abstractions.
Well known algorithms :
http://cs.marlboro.edu/ courses/ spring2014/workshop/ notes/ tron_tourney_2
last modified Tuesday February 18 2014 1:45 am EST