Code Retreat at the Faculty of Computer Science

Inspired by this article from SKB Kontur, they decided to hold a Code Retreat at their faculty (Tomsk State University, Faculty of Informatics). True, our goal was not teaching specific technologies, but rather just acquaintance (half of the participants from 1-2 courses), fan and a bit of abnormal programming.

Briefly about the format of the event


  1. Sessions of 45 minutes (total was 4 sessions + introductory quest).
  2. Between sessions, a break of 15 minutes with coffee and buns.
  3. One task for all sessions, but each session declares a limit for this round.
  4. Programming takes place in pairs (Encoder and Navigator), the couple has one computer, at the same time only one person writes the code (Encoder).
  5. Each session the couples change.
  6. Every 11 minutes, the couple changes roles.

The standard format restriction “after each session the code is deleted”, it was decided not to enter at our event, because there wasn’t much confidence that everyone would complete the task on time (after all, the participants were not professional programmers, but mostly junior students).
In addition, to increase the FpM index (fun per minute), additional restrictions were introduced that were not related to the Code Retreat format:

  1. Each round is announced yet another general restriction of amusement.
  2. Each team receives a personal entertainment restriction.

The task


Now move on to the specifics. The task is to write an interpreter of the esoteric programming language HQ9 +. The task for the 0th round was to determine the task. To do this, on social networks (Twitter, Google+, Vkontakte), tips (text and pictures) were published under the tag # coderetreat4csd. There were 3 branches of tips that ended with the answers “Hello, world!”, “Quine”, “99 bottles of beer” (3 main components of the HQ9 + language), which should have led to the correct answer. I will not list the quest tasks themselves, I can only say that it was aimed at studying the features of various technologies: rarjpg, base64, code obfuscation (using js as an example), couer codes with pictures (serious guys, do not skeptically wrinkle your forehead - for the first or second of the course are quite unobvious things, especially when you have never met them in your life, and the time for the 0 round was limited to 30 minutes).
As a result, no one decided for the allotted time, although individually at least one team went through each quest line individually. Using leading questions, the task was conveyed to the participants, after which everyone went to eat and tell each other what the interpreter was, because some started to panic.

1 round


There are no restrictions. There is no fun task. There are no individual tasks. Populated by robots .
Nothing special happened here, everyone sat down on teams and started to code. I must say that almost all the teams spent most of the allotted time, because slowly drove in, taught the younger ones, morning, and indeed, ping is big and mom called . But in the end, everyone managed (someone even managed to automatically run the tests we prepared, which was absolutely not necessary), and went to eat sandwiches.

2 round.


Restriction: do not use the characters H, Q, 9, + in the source code of the program. A fun task: music plays in the background, you need to change not once every 11 minutes, but for each song. There are individual restrictions (in all subsequent rounds too).
Everything has become more fun. The ability to reuse the code did not help much, because you got to a new computer, you saw the code for the first time, and often you didn’t even know how to program in the language in which they were written. But still very few people wrote the code again, everyone tried to somehow adapt to what was already written. The funniest in this sense was the pattern code that someone managed to write in the first round. This was the only time that other teams sitting on this computer were really comfortable.
The restriction turned out to be much more interesting than we planned. The inability to use string literals with the letters H, Q, 9, + forced to put all the strings into files or use ASCII codes. The inability to use while, then (for Pascal), throw, catch, made the coding process much more fun than in round 1, although when we came up with round 2, it seemed to us not very difficult.
Music delivered. The playlist was chosen in such a way as to bring the maximum amount of fan, distracting only occasionally. I must say that the participants were persistent, neither Ranetki nor Kirkorov, they were not penetrated. All focused coding.
Individual tasks were also excellent. The most interesting of them:

  1. The encoder uses only the keyboard, and the navigator uses only the mouse.
  2. As identifiers use only kosher names.
    var cashrut = new StreatReader("input.txt");
    string halacha = "";
    string jewish;
    // List rennet = new List();
    while ((jewish = cashrut.ReadLine()) != "" && jewish != null)
    {
        halacha = String.Concat(halacha, jewish);
    }
    List curds = new List();
    while (curds.Count != 99)
        curds.Add(0);
    var birdsOfPrey = new StreamWriter("output.txt");
    int rennet=halacha.Count(p => p == '+');
    foreach (char clovenHoof in halacha)
    {
    
  3. Write code with one finger.
  4. Write a code with the caps on.

As a result, individual tasks did not interfere much, but added fun to both the participants themselves and others. In general, almost all completed this task. And, as always, food.

3 round


Limitation: do not use arithmetic operators (including bitwise) and comparison operators. A fun task: participants take turns writing a fairy tale about a programmer on Code Retreat.
The limitation was not as complicated as we expected. We thought everyone would rush to write a long addition, but it wasn’t there. As a result, there were 3 solutions: append to a string and take Length, add using .NET Expressions, count the number of “+” characters in the input file using the Count extension from LINQ (not a very honest solution, but the tests pass, and we really liked).
The tale turned out to be trashy. Some kind of mixture of philosophy, zen and hopelessness. Then we type and lay out.
Of the amusing individual restrictions in this round, I remembered only “With every successful build, shout“ NYA! ”And dance the dance of little ducklings.” But it amused not only the team itself, but everyone around it.
Food.

4 round


Limitation: do not use loops, goto, and collections (except for strings). Fun mission: no.
The main idea was to encourage the guys to use recursion. Strings were allowed only to simplify work with string literals (in order not to read a string from a file each time, because in the recursive version this is generally some kind of trash). As a result, because of this indulgence, a funny solution to String.Replace passed, but we don’t worry, we really liked it too. Almost all the teams reached recursion, some of them in half the time, we proposed to them to solve the stack overflow problem on a very large sequence of commands. Here it was necessary to get to the idea of ​​using new threads or even processes when reaching a large stack depth, and some even came up with this solution, but nobody had enough time to implement it.
We did not add a fun task for this round, because believed that the main limitation is already complex. As a result, on average, participants managed this round even faster than the previous ones, apparently swinging in 4 hours.
Interesting individual restrictions:

  1. The navigator blindfolds.
  2. Use only "_" for identifiers.
            case '9':
                {
                    var __________ = new StreamReader("lyrics.txt");
                    string _________ = __________.ReadToEnd();
                    __________.Close();
                    ________.WriteLine(_________);
                    break;
                }
        }
        if (_.Length == 1) return ______;
        else
        {
            _ = _.Remove(0, 1);
            ______=__(_, ___, ______);
            return ______;
        }
    }
    
  3. Identifiers in Chinese.
    static void Main(string[] args)
    {
        輸入 = File.ReadAllText("input.txt");
        FileStream 作為故事講述 = new FileStream("output.txt", FileMode.Create);
        FileStream 用故事畫裝飾 = new FileStream("counter.txt", FileMode.Create);
        閱讀 = new StreamWriter(作為故事講述);
        StreamWriter 他編造了他的學歷經歷 = new StreamWriter(用故事畫裝飾);
        表(輸入);
        他編造了他的學歷經歷.Write(計數器);
        他編造了他的學歷經歷.Close();
        閱讀.Close();
    }
    
  4. Do not use spaces or tabs.
    private
    static
    void
    ReadSymbol(in
    i)
    {
    char[]
    c=new
    char[1];
    if(file.Read(c,i,1)<=0)
    return;
    i++;
    switch(c[0])
    {
    case
    'H':file1.WriteLine("Hello,world!");break;
    case
    'Q':file1.WriteLine(file);break;
    case
    '9':file1.WriteLine(stih);break;
    case
    '+':count++;break;
    }
    }
    }
    }
    

The end. Cleaning. Valim.


The event turned out to be very fun and not very difficult. 16 participants (from all courses, from 1 bachelor's degree to 2 master's degrees), 8 organizers, a bunch of food, 5 hours of coding, 3 programming languages ​​(Object Pascal, C #, C ++). Everyone is happy, so are we. We will spend more. Program more and enjoy it!

Also popular now: