The latest instance of the course can be found at: O1: 2024
Luet oppimateriaalin englanninkielistä versiota. Mainitsit kuitenkin taustakyselyssä osaavasi suomea. Siksi suosittelemme, että käytät suomenkielistä versiota, joka on testatumpi ja hieman laajempi ja muutenkin mukava.
Suomenkielinen materiaali kyllä esittelee englanninkielisetkin termit. Myös suomenkielisessä materiaalissa käytetään ohjelmaprojektien koodissa englanninkielisiä nimiä kurssin alkupään johdantoesimerkkejä lukuunottamatta.
Voit vaihtaa kieltä A+:n valikon yläreunassa olevasta painikkeesta. Tai tästä: Vaihda suomeksi.
Chapter 12.1: Robot Tournament
About This Page
Questions Answered: Which robot tribe is the best?
Topics: Designing your own algorithm. Programming in something that vaguely resembles machine language.
What Will I Do? Program.
Rough Estimate of Workload:? Depends entirely on how much effort you want to put in.
Points Available: C100. You’ll get a minimum of fifty just for taking part; the other fifty comes from your placement in a tournament.
Related Projects: RobotTribes.
Program Your Own Robot Tribe
This chapter consists of a single programming assignment. It continues where Chapter 11.3 left off.
Task description
Define your own robot tribe in RoboSpeak. Try to design it to be effective in duels against other tribes.
Instructions and hints
At the end of this page is a form for submitting two files:
mytribe.tribe
, which contains the RoboSpeak for your tribe; andmytribe.png
, which is the image you’ve chosen to depict your tribe’s robots.
You won’t submit any Scala code in this assignment.
The general instructions for placing the RoboSpeak and image files within the project are in Chapter 11.3.
You can use one of the given image files, or you can create or download some other image.
It would be nice if you’d start the RoboSpeak program with a comment that introduces your tribe and its behavior. If you want to write other comments in your code, that’s great too, but commenting isn’t mandatory.
You must use the RoboSpeak language as defined in Chapter 11.3. Even if you’ve made your own additions to the language, don’t use them in this tribe.
The tribe file mustn’t be larger than a few dozen kilobytes. During the tournament (see below), a maximum of one thousand RoboSpeak instructions will be executed during a single robot turn.
You may find writing programs in RoboSpeak to be arduous work. Sorry! ;-)
Grading
The only thing that A+ will automatically assess is whether your RoboSpeak program is at all compatible with the RobotTribes project. You’ll need to pass that preliminary check to score any points for this assignment. If your program fails to run or ends up in an infinite loop during this check, A+ will give you zero points. Otherwise, A+ gives you one (1) point to signal that you passed the initial test. This is just the prologue to the actual assessment, though.
Immediately after the deadline, the course staff will check all the programs that passed the initial test. Assuming the staff member approves your program, you are certain to score a minimum of 50 points for it. We’ll approve any and all programs that demonstrate an effort to write a new tribe. It doesn’t need to be fancy and it doesn’t need to be big, but it needs to be something that you created.
One of the teaching assistants will organize a tournament that pitches the approved tribes against each other. Your final score, between 50 and 100, is determined by how well your tribe does in that tournament.
We’ll add the final scores in A+ after the deadline, as soon they’re ready.
The Tournament
Duels and matches
The tribe submitted by each student or pair will fight one “match” against each other student-created tribe. A match is a sequence of duels. Each duel is set up as follows:
- The dueling ground is a 20-by-20 robot world with ten walls at random locations.
- The two dueling tribes each start with six robots. The robots are initially placed in random locations and face in random directions.
- In addition to the dueling tribes, there are 30 peaceful robots
of the bunny tribe (see
bunny.tribe
). The bunnies are placed at random locations that aren’t adjacent to any of the dueling robots.
That is, the settings are the same that you get by selecting Tribal ‣ Basic Duel in the app’s GUI.
If one of the tribes wipes its opponent off the map, it wins the duel. It can also happen that neither side is completely annihilated. In that case, the winner is the tribe with more robots after many rounds of play.
The winner of a match is the tribe that won more duels (against the same opponent). The winner of the tournament is the tribe that won the most matches (against different tribes). The more matches your tribe wins, the more points you’ll score.
Finals and awards
If all goes well, we’ll present the robot tournament’s results at O1’s final lecture (Wednesday, December 12th, 2018, at 15–17 in hall T1 of the CS building; primarily in English). We’ll also organize, just for fun, a knockout stage featuring some of the tribes that placed highest in the tournament proper. (This has no impact on scoring.)
We’ll see if we can come up with small prizes for the creators of the top tribes.
The lecture is almost immediately after the deadline. If something happens and we don’t have the tournament results in time, we’ll do the knockouts on video in A+ afterwards.
Submission Form
A+ presents the exercise submission form here.
Feedback
Please note that this section must be completed individually. Even if you worked on this chapter with a pair, each of you should submit the form separately.
What now?
O1 ends here... almost. Here’s what’s left:
- Chapters 12.2 and 12.3, which contain some optional reading on files and the Swing GUI library, respectively.
- The course-ending lecture immediately after the Week 12 deadline. Come there for the robot tournament and other things.
- Week 13, which opens soon after that lecture. It doesn’t have any normal chapters, but it does contain the mandatory end-of-course feedback form in Chapter 13.1. You’ll need to fill that in by December 19th. We’ll also publish a final weekly bulletin as Chapter 13.0.
This ebook continues into Week 14 and beyond. Those weeks are part of the spring course Programming Studio 2.
Credits
Thousands of students have given feedback that has contributed to this ebook’s design. Thank you!
Weeks 1 to 13 of the ebook, including the assignments and weekly bulletins, have been written in Finnish and translated into English by Juha Sorva.
Weeks 14 to 20 are by Otto Seppälä. That part of the ebook isn’t available during the fall term, but we’ll publish it when it’s time.
The appendices (glossary, Scala reference, FAQ, etc.) are by Juha Sorva unless otherwise specified on the page.
The automatic assessment of the assignments has been programmed by Riku Autio, Jaakko Kantojärvi, Teemu Lehtinen, Timi Seppälä, Teemu Sirkiä, and Aleksi Vartiainen.
The illustrations at the top of each chapter, and the similar drawings elsewhere in the ebook, are the work of Christina Lassheikki.
The animations that detail the execution Scala programs have been designed by Juha Sorva and Teemu Sirkiä. Teemu Sirkiä and Riku Autio have done the technical implementation, relying on Teemu’s Jsvee and Kelmu toolkits.
The other diagrams and interactive presentations in the ebook are by Juha Sorva.
The O1Library software has been developed by Aleksi Lukkarinen and Juha Sorva. Several of its key components are built upon Aleksi’s SMCL library.
The pedagogy of using tools from O1Library (such as Pic
) for simple graphical programming
is inspired by the textbooks How to Design Programs by Flatt, Felleisen, Findler, and
Krishnamurthi and Picturing Programs by Stephen Bloch.
The course platform A+ has been created by Aalto’s LeTech research group and is largely developed by students. The current lead developer is Jaakko Kantojärvi; many other students of computer science and information networks are also active on the project.
For O1’s current teaching staff, please see Chapter 1.1.