back to article Reg Programming Compo: 22 countries, 137 entries and... wow – loads of Python

Our latest programming competition was our most popular yet in terms of the number of entries – 137 in all once we'd de-duplicated them. The judges were intrigued to see just how popular Python is these days: nearly half (a smidge over 48 per cent) of the entries used this as the language of choice, with Java the next most …

  1. stephanh

    Python dict order

    Python implements "hash randomization"; the hash of a string is different from run to run. This is done to avoid DOS attacks on the hash algorithm (i.e. an attacker may create malicious input which intentionally causes hash collisions). As a result, set and dict iteration order may change from run to run.

    On an unrelated note: do the participants get feed-back on how well they did? I.e. if they passed all the tests, or which ones they failed?

    1. Charlie Clark Silver badge

      Re: Python dict order

      Well, Python 3 will reseed the hash for each process. But really you should never be relying on order for hashes anyway. Had to write a couple of tests in the past that did, the tests ended up being easier to understand! :-)

    2. alisonken1
      Linux

      Re: Python dict order

      Actually, with python3 you can use an OrderedDict() to create a dictionary that is ordered based upon the sequence of how they were entered.

      from collections import OrderedDict

      (El Reg really does need a python icon)

  2. Dan 55 Silver badge
    Windows

    I'm with the picture editor

    At least they know what a proper language is.

    No cheating, it can't be changed now.

    1. Gordon 11

      Re: I'm with the picture editor

      At least they know what a proper language is.

      Perl was designed for tasks such as this.

  3. Roq D. Kasba

    Please tell me you put all the results in a file

    And let the software vote for who it wanted to win

  4. Tom_

    137 Entries?

    Damn, I wish I'd made the effort now! :)

    Would have liked to do it in C++, though, if it had been on the list.

  5. Mario Becroft
    WTF?

    Fortran 90 "weird?" I don't think so.

    Fortran is a very common language (particularly in research and supercomputing).

    Referring to the original competition rules, the allowed languages list is highly biased towards Algol-derived, object oriented languages. The competition would have been more interesting if other languages were included, e.g.: Common Lisp, Haskell, Scala, Smalltalk, SQL etc.

    1. JetSetJim
      Coat

      Re: Fortran 90 "weird?" I don't think so.

      Special prizes for entries in Malbolge

    2. Charlie Clark Silver badge

      Re: Fortran 90 "weird?" I don't think so.

      The competition would have been more interesting

      The answers might have been more interesting, but not the competition which was trivial.

      Where's the link to the answers?

    3. Dave_uk

      Re: Fortran 90 "weird?" I don't think so.

      first time I have have heard "Smalltalk" mentioned in 20yrs!

      PHP use is dropping but smalltalk was never hardly used:

      https://www.google.co.uk/trends/explore?date=all&q=php,smalltalk

  6. Sutekh849

    Runners up?

    Ah, wonder how close I was. I'd assumed it would be tested on execution time.

    1. Anonymous Coward
      Joke

      Re: Runners up?

      > Ah, wonder how close I was. I'd assumed it would be tested on execution time.

      The winner was the person who included a witty comment in the comments about ear-shaped fungi growing out of trees. He still won't actually receive a prize though.

  7. TRT Silver badge

    Daley Thompson. BORING?

    He spawned his own computer game... in case you were looking for an IT angle... ah... maybe not.

    1. Admiral Grace Hopper
      Thumb Up

      Re: Daley Thompson. BORING?

      As soon as read the words, "Daley Thompson", I was mentally transported to the console of an arcade game in 1984 and memories of furiously pounding the buttons in the running events.

      1. TRT Silver badge

        Re: Daley Thompson. BORING?

        The death of many a joystick. I favoured the TAC-2's all metal construction - a stainless steel shaft through a shaped neoprene washer to provide the centering force, a large stainless steel ball screwed onto the shaft made contact with one or two of the four large brass sprung plates in the base. The fire buttons were large brass washers push fitted onto chunky solid plastic moulded buttons, held in place by large compression springs.

        Almost indestructible, it was let down by the lack of an auto fire function, which I supplied by building a small 555 circuit in a box which sat in-between the C64 and the joystick. I ended up making those to sell to school friends. Must have built a couple of dozen at least.

  8. Chris Watson 2

    Congratulations Brett.

    It would be nice for the rest of us (i.e. the losers) if we could see whether we passed or failed the judging tests.

  9. Anonymous Coward
    Anonymous Coward

    Not quite what it said in the rules...

    So, not to be a stickler.. well, actually to be quite an annoying arse of a stickler..

    The rules say this (in T&Cs): "The goal of this challenge is for participants to solve a programming exercise. The participant with the fastest and most accurate code will ultimately win a prize at the end of THE CHALLENGE. "

    This statement from the article above: "We then had to look at the remaining solutions that had processed the data correctly and decide which we liked most with regard to how they were written, the clarity of the code, the efficiency of the algorithm (not the actual execution time – that would be an unrealistic comparison) and so on."

    I am not sure these two are directly compatible. I chose Java simply because I thought it would be quicker as the rules said it would be the fastest code that won...

    1. Lennart Sorensen

      Re: Not quite what it said in the rules...

      The rules also say there won't be two competitors with the same score, so not sure why they talk about the behavior of programs when that happens.

      1. Chris Watson 2

        Re: Not quite what it said in the rules...

        "Output data

        [...] You may assume that there will not be any competitors with the same total score."

        "Our test data contained some examples where two competitors ended up with the same score."

        So it does.

        1. Lennart Sorensen
          Happy

          Re: Not quite what it said in the rules...

          I guess the judges forgot to read the rules.

  10. cford

    Test data?

    How about publishing the data files that you used to score the programs. We could test how well our programs worked against your test set...

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Other stories you might like