{"id":9535,"date":"2016-09-13T18:07:59","date_gmt":"2016-09-13T16:07:59","guid":{"rendered":"https:\/\/informatica.uniurb.it\/triennale\/?p=9535"},"modified":"2016-09-14T12:03:00","modified_gmt":"2016-09-14T10:03:00","slug":"treasurehuntbot","status":"publish","type":"post","link":"https:\/\/informatica.uniurb.it\/triennale-informatica\/treasurehuntbot\/","title":{"rendered":"Implementing a bot-based treasure hunt game"},"content":{"rendered":"
On August 26th, during the course of the \u201cCoding in your Classroom, Now!\u201d summer school, a large treasure hunt game<\/strong> took place in the historical center of Urbino:\u00a026<\/strong> groups, composed of 139<\/strong> participants overall, challenged each other by chasing clues through the narrow and steep streets of the city, following the orders of a\u2026 bot<\/strong>.<\/p>\n The game had been developed during the week just before the event and the whole team behind the treasure hunt\u00a0spent the last minutes before the start feverishly fixing the last bugs. (Well, most of them.)<\/p>\n The summer school, aimed at school teachers of all grades, had the main focus of bringing coding to the classroom, in a way that could be engaging for both teachers and young students.\u00a0Thus, it made more than sense that the treasure hunt itself, \u201cUrbino Code Hunting<\/a>\u201d as it was called, would be based on coding puzzles as well.<\/p>\n <\/p>\n What made the treasure hunt interesting is that the whole registration process, the actual hunting, puzzling, and other game mechanics were directly handled by a Telegram bot<\/a>. Anyone with a Telegram account could very easily register during the 4 days before the game just by entering a conversation with it.<\/p>\n The bot asked registrants to solve\u00a0a \u201cpreliminary\u201d puzzle (to prepare players for what would have come later and to work as some kind of captcha<\/em>), how many other participants would have taken part to the game together\u00a0with the team leader, and the team\u2019s name.<\/p>\n Usually a treasure hunt game requires players to find hidden objects or reach secret locations based on some\u2014more or less vague\u2014clues. In our case, the actual puzzling was\u00a0centered around coding questions delivered by the bot, not around recognizing locations from clues, both because coding was\u00a0the theme of the game and because many participants weren’t familiar with the city. Therefore,\u00a0locations to reach were given out explicitly by the bot.<\/p>\n The actual gameplay<\/strong>\u00a0was\u00a0structured\u00a0as follows:<\/p>\n We identified 30 well-distributed locations around the town<\/a>, which we marked with a description, a precise GPS location, a numeric ID, and a secret code (16 random alphanumeric characters).<\/p>\n How did\u00a0the bot ensure that a group has reached its destination? Easy. We printed 30 paper signs (on A4 sheets), one for each location, with a special QR Code linking to an URL following this scheme:<\/p>\n This link makes use of the deep linking<\/em> feature<\/a> of Telegram: after opening the URL through a QR Code scanner, the user’s phone automatically starts the Telegram client and sends the \u201c The bot tracked\u00a0each group making its way through a sequence\u00a0of 12 locations. To ensure that groups of players do not follow each other and that they don’t cluster in the same area, the\u00a0sequence of locations to reach for each group was\u00a0chosen at random.<\/p>\n Puzzles\u2014which were\u00a0given out as soon as a group reached a location and sent\u00a0a confirmation selfie<\/em> of the group\u2014were\u00a0based on the CodyRoby quizzes<\/a> .\u00a0These simple logical puzzles make use of shared conventions, like the colored pseudo-code blocks from Blockly<\/em> used in Code.org and the CodyRoby coding cards<\/a> .<\/p>\n Sample question.<\/em><\/p>\n All puzzles required at most a couple of minutes to be solved and the answer could\u00a0be provided as a simple text message, usually with a single character or a single number.\u00a0Answers would be\u00a0accepted quite liberally, with whitespace, in upper or lower\u00a0case, and with any formatting. Wrong answers caused\u00a0a forced delay of 60 seconds before the next attempt.<\/p>\n Correct answers not only let the group move forward, but they also rewarded the group with an important clue that would then\u00a0be used to solve the last riddle: as soon as a group reached the last location (which we made sure was the same for all groups), they were\u00a0given a map (like, a real, tangible, honest to goodness map made out of paper) that could\u00a0be used to find out\u00a0the exact place where the coveted prize was\u00a0hidden.<\/p>\n The first group that reached it would get to keep the prize and receive\u00a0another wonderful QR Code. Who doesn’t love QR Codes anyway? This last code signaled\u00a0that the game was\u00a0over for everyone.<\/p>\n
<\/p>\nRegistrations to the game were handled by a run of the mill conversation with the bot.<\/h4>\n
<\/p>\n\n
Each location had\u00a0its own secret 16-character code.<\/h4>\n
https:\/\/telegram.me\/treasurehuntbot?start=0123456789ABCDEF<\/pre>\n
\/start 0123456789ABCDEF<\/code>\u201d string to our bot, without actually displaying it inside the conversation screen. Since each\u00a0QR Code contained the location\u2019s\u00a0secret\u00a016-character code inside the URL, the bot would\u00a0know with certainty which code the group had\u00a0scanned and thus which location was reached.<\/p>\nIn order to ensure fairness, sequences of locations were generated beforehand with a bounded maximum (and minimum) length.<\/h4>\n
<\/p>\nA Telegram channel was\u00a0used to broadcast information, to share selfies<\/em>, and to make the game more engaging.<\/h4>\n