This course has already ended.

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.

Kieli vaihtuu A+:n sivujen yläreunan painikkeesta. Tai tästä: Vaihda suomeksi.


Chapter 12.3: Robot Tournament

About This Page

Questions Answered: Which robot tribe is the best?

Topics: Designing your own algorithm. Programming in something that vaguely resembles symbolic machine language.

What Will I Do? Program. Compete, if you want.

Rough Estimate of Workload:? Depends entirely on how much effort you want to put in.

Points Available: No official O1 points. (For most O1 students, this chapter is completely optional. However, if you are taking Programming Studio 1 in parallel with O1, do note that these assignments are an official part of that course. Also, there will be some small prizes to whichever students do best in the robot tournament.)

Related Modules: RobotTribes.

../_images/robot_fight.png

Program Your Own Robot Tribe

This chapter consists of a single programming assignment. It continues where Chapter 10.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

  • For this assignment, you will submit two files:

    • mytribe.tribe, which contains the RoboSpeak for your tribe; and

    • mytribe.png, which is the image you’ve chosen to depict your tribe’s robots.

    You don’t submit any Scala code.

  • The general instructions for placing the RoboSpeak and image files within the module are in Chapter 10.3.

  • You can use one of the given image files, or you can create or download some other image.

  • Please write a comment at the top of your RoboSpeak program to briefly introduce 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 10.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.

  • A+ assesses whether your RoboSpeak program is compatible with the RobotTribes module. You’ll need to pass that preliminary check to participate in the tournament. If your program fails to run or ends up in an infinite loop during this check, A+ will notify you when you submit.

  • While testing, you may wish to set the random seed so that duels start from the same starting positions when you relaunch the app. To do that, edit util.scala.

  • You may find that writing programs in RoboSpeak is arduous work. Sorry! ;-)

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 more matches your tribe wins, the better. The winner of the tournament is the tribe that won the most matches (against different tribes).

Submitting your solution to participate in the tournament

A+ presents the exercise submission form here.

Results

The robot tournament’s results will be published soon after the Week 12 deadline by the course Programming Studio 1. We’ll also put a link to the results in O1’s final bulletin in Chapter 13.0. Anyone who participates will be eligible for the small prizes that will be awarded to the creators of the top tribes.

Finals and prizes

Assuming all goes well, the robot tournament’s results will be presented at O1’s end-of-course event (Friday, December 8th, 2023, at 3 p.m. in Hall T1 of the CS building; primarily in English). At the same event, there will be a knockout stage featuring some of the tribes that placed highest in the tournament proper. (This is just for fun and has no impact on scoring.)

There will be small prizes for the creators of the top tribes.

The end-of-course event is soon 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.

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.

Credits

Thousands of students have given feedback and so contributed to this ebook’s design. Thank you!

The ebook’s chapters, programming assignments, and weekly bulletins have been written in Finnish and translated into English by Juha Sorva.

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 developed by: (in alphabetical order) Riku Autio, Nikolas Drosdek, Kaisa Ek, Joonatan Honkamaa, Antti Immonen, Jaakko Kantojärvi, Niklas Kröger, Kalle Laitinen, Teemu Lehtinen, Mikael Lenander, Ilona Ma, Jaakko Nakaza, Strasdosky Otewa, Timi Seppälä, Teemu Sirkiä, Anna Valldeoriola Cardó, 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 did 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 O1Library for simple graphical programming (such as Pic) 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+ was originally created at Aalto’s LeTech research group as a student project. The open-source project is now shepherded by the Computer Science department’s edu-tech team and hosted by the department’s IT services. Markku Riekkinen is the current lead developer; dozens of Aalto students and others have also contributed.

The A+ Courses plugin, which supports A+ and O1 in IntelliJ IDEA, is another open-source project. It has been designed and implemented by various students in collaboration with O1’s teachers.

For O1’s current teaching staff, please see Chapter 1.1.

Additional credits for this page

The notion of programmable “tribes” or “species” that fight each other on a grid comes from a programming assignment by Nick Parlante.

Onni Miettinen, Niklas Koskela, Viljami Nurminen, and Rune Pönni contributed additional commands to the RoboSpeak language and other improvements. Their work was inspired by student feedback.

Teemu Sirkiä wrote the code for running the robot tournament. Joonatan Honkamaa and Otto Seppälä suggested an efficiency improvement to TribalBot for tournament purposes.

a drop of ink
Posting submission...