back to article You gotta be in it to win it: The Register presents its official Programming Competition

Calling all you programmers out there! We have a simple challenge for you – and if you win, you bag yourself a rather smart Smart TV. Read on to find out how you can get involved... Sign up for a trial account with IBM Bluemix. Actually do this now! Check out the competition questions here. Implement and publish your three …

COMMENTS

This topic is closed for new posts.
  1. This post has been deleted by its author

  2. Anonymous Coward
    Anonymous Coward

    This could be good....

    ...so many here shout how amazing their skills are and how everyone else does it so badly. Now time to see.

    1. Antonymous Coward
      Holmes

      Re: This could be good....

      I have a suspicion the shouty ones won't be participating :(

    2. This post has been deleted by its author

      1. Marco Fontani

        Re: This could be good....

        I'll get you started :)

      2. Anonymous Coward
        Holmes

        Re: This could be good....

        On the subject of your damned Acme splaffer... *spits*... where did you get your list of retired icons? Sadly http://www.theregister.co.uk/Design/graphics/icons/comment/ is set to splaff Reg's rather charming little 404 doodle rather than a proper index :o(

        1. This post has been deleted by its author

          1. Anonymous Coward
            Facepalm

            Re: This could be good....

            I looked through old posts where they were more commonly used.

            Crap! Had a feeling it'd be something along those lines. Bugger that for a game of soldiers.

            ...it took a long time to track down posts that used them.

            Don't suppose you feel like posting a nice list then?!

            :O)

            1. This post has been deleted by its author

              1. Anonymous Coward
                Meh

                Re: This could be good....

                What's the point? Just so that everyone can post with old icons manually?

                Pretty much. Nostalgia I suppose. Could brighten the place up a bit if anyone takes an interest. I fancy the subset we're permitted to play with now is getting a bit stale.

                I don't suppose it could hurt to splaff 'em into the forum proper and see if there's any interest... if you feel inclined...

                If people are really, really interested, I'll post the source to the Acme Splaffer. I'm surprised nobody else has written one, it's hardly difficult.

                Hell no! For Christ's sake don't do it. Not that! NOoooooo.........

                *spits*

  3. Alan Mackenzie
    WTF?

    It's a bit vague, isn't it?

    What language are these exercises to be coded in? Assembler (for speed), or what?

    1. Fibbles

      Re: It's a bit vague, isn't it?

      Bluemix supports several programming languages including Java, Node.js, Go, PHP, Python, Ruby Sinatra, Ruby on Rails and can be extended to support other languages such as Scala through the use of buildpacks.

      The competition doesn't appear to mandate a specific language.

      1. razorfishsl

        Re: It's a bit vague, isn't it?

        Yes why fuck it up in one language, when you can use a multi-verse approach....

        Reminds me of some inexperienced kid with a tool box full of dildos trying to impress his latest girlfriend.

        1. This post has been deleted by its author

  4. OrneryRedGuy

    Effective product promotion

    Left-pondian here, so I won't be participating. But in general, this is exactly the kind of thing that would get me engaged - give me a chance to stroke the ol' ego and dangle something shiny in front of me at the same time. I heartily encourage more companies to spend their advertising dollars this way.

    (I learned Java under similar circumstances and have no regrets even though all I got out of it was a t-shirt ('participant'). Oh, and later on a career.)

    1. Anonymous Coward
      Anonymous Coward

      Re: Effective product promotion

      Nice to know Java even if it is dangerous to have the run time installed outside a VM.

  5. cjcox

    No scruples

    This contest is NO contest. Has nothing to do with programming, skills, etc...

    This is simply IBM marketing and propaganda around their (less than successful) cloud offerings.

    Anybody want to take and make this into a *real* contest without the IBMisms?

    I don't think there's a scruple left inside of IBM.

    1. Fibbles

      Re: No scruples

      The questions look like something taken straight from an A-Level Computing exam and really shouldn't pose a problem to anyone here. Similar to most 'competitions' in the UK the questions are there simply to avoid laws governing lotteries.

      1. Anonymous Coward
        Anonymous Coward

        Re: No scruples -and really shouldn't pose a problem to anyone here

        ...one way to tell me I should stop reading The Register now I've retired. I just can't summon up the enthusiasm to do this sort of thing any more.

        The data entry format suggests that the problems were first written back in the day when you submitted them on punch cards or paper tape. Not that this is a bad thing, as the younger generation perhaps needs to know that the first step in writing a program is not to design the UI or select the protocol.

        I found this helpful some years ago:

        how (not) to write Factorial in Java.

      2. Tim Worstal

        Re: No scruples

        "and really shouldn't pose a problem to anyone here."

        Hmm....I'm still struggling mightily to find a supplier of the 1s and 0s that I'm told code is made of. And where is the tank on the computer that you pour them into?

        1. Fibbles

          Re: No scruples

          Hmm....I'm still struggling mightily to find a supplier of the 1s and 0s that I'm told code is made of. And where is the tank on the computer that you pour them into?

          I believe that traditionally the 1s and 0s are 'fed' into the computer rather than poured. Try looking for some sort of orifice with teeth?

    2. This post has been deleted by its author

      1. Fibbles

        Om nom nom, tasty bait.

        Just post your solutions to the problems here, written in your language of choice, if you feel the need to prove anything..

        Written in C++11. Input is only sanitized as much as the questions specified. Command line only because I can't be arsed implementing a GUI. Probably not that efficient.

        Question 1

        Question 2

        Question 3

        FYI el reg competition organizers; if 90% of your programming challenge is string manipulation then you have created a boring challenge.

        1. This post has been deleted by its author

          1. amanfromarse

            Re: Om nom nom, tasty bait.

            Oh dear.

  6. Anonymous Coward
    Anonymous Coward

    Blah blah blah... <paraphrase> coding is better done in the cloud due to the time it takes to set up the IDE </paraphrase>...

    My eyeballs nearly caught fire as they screeched to a halt over that. I've known some seriously bad developers in my time but I can't think of any so bad that they couldn't even make their IDE compile a simple application. I think a lot more time would be wasted trying out different language and development environments that sitting down in front of a regular IDE and just getting on with some work. And what happens when the cloud IDE doesn't support some weird and wonderful plugin you want for Eclipse? etc etc

    I'm not saying this idea hasn't got legs but the justification after the mid-article heading is just crazy talk. You'll pry my IDE out of my cold dead hands. Now I'm off to take part and show off my leet mad coding skills, or something like that.

    1. joeldillon

      'IDE'? You mean vi?

      1. asdf

        Geany if you absolutely have to use a GUI.

    2. razorfishsl

      Go check out "Wavemaker"

      IDE in the cloud using Java, only 10k per year, not including other fees.........

      1. Will Godfrey Silver badge
        Happy

        @asdf

        For shits and giggles do it in pygame

        1. This post has been deleted by its author

        2. This post has been deleted by its author

  7. lawndart

    types:

    10 GOTO 10

    20 PRINT "HELLO IBM"

  8. Anonymous Coward
    Coffee/keyboard

    Do I win?

    10 REM El Reg forum manager

    20 INPUT "Enter your post"; A$

    30 PRINT A$

    40 PRINT "▲1 ▼97"

    50 GOTO 20

    > ▄

  9. Kevin McMurtrie Silver badge

    Cloud development environments let you concentrate on the important part

    That would be tracing, translating, and debugging RPCs. You haven't experienced "cloud" computing until you've dealt with fixed length RPCs using binary records, SOAP, Java RMI, JSON REST, Protocol Buffers, and my favorite of "I wrote this one night while drunk" which is usually some form of "put the file here then wait for a new file there."

  10. TitterYeNot

    #!/bin/bash_my_head_against_a_brick_wall

    if (($ego > 100)) && (($gullibility_regarding_IBM > 1000)); then

    echo "Yay let me do it OMG LOL!" | sell_your_soul_to_the_cloud > /dev/null 2>&1

    else

    while [ $had_enough_yet? != "true" ]; do

    echo "meh whatever dude..."

    done

    fi

    <Buggrit where's my sandals gone...>

    1. Anonymous Coward
      Anonymous Coward

      Re: #!/bin/bash_my_head_against_a_brick_wall

      Important to get those environment variables right. Are they by user or are they system wide?

  11. Stevie

    Bah!

    Dilbert would simply craft a new language in which the program text would be:

    task();

  12. Borg.King
    Pint

    What's the TV worth

    A grand? Not worth my time. I've spurned more income just drinking a beer or three.

  13. Anonymous Coward
    Anonymous Coward

    Question 1: Factorials for input from 1 through 15 inclusive.

    Anyone who writes a math function for this, and not a switch statement using precalculated results has lost.

    $0.02

    1. Anonymous Coward
      Anonymous Coward

      Re: Question 1: Factorials for input from 1 through 15 inclusive.

      "Anyone who writes a math function for this, and not a switch statement using precalculated results has lost."

      I'm assuming that the point was to eliminate everybody who started off

      public static int factorial(int n){................ or its equivalent.

      However, in Python ordinary ints are automatically promoted to bigints when needed, so a simple recursive factorial function will do the job perfectly and occupies less space than a switch statement. Code length (and possibility of mistyping a number) versus execution time and memory? You tell me.

    2. This post has been deleted by its author

      1. Anonymous Coward
        Anonymous Coward

        Re: Question 1: Factorials for input from 1 through 15 inclusive.

        That won't solve the problem because you then have to convert the output to a CR-terminated string, which takes rather more work in assembler.

        Also it is CPU-dependent because you will need a 64 bit by 64 bit multiply. Factorials get big very quickly.

  14. Schlimnitz

    They had me right up 'til

    They wanted my first name, last name, phone number, email, password, password, security question, security answer.

    1. Anonymous Coward
      Pirate

      Re: They had me right up 'til

      In IBM competitions you're the prize.

    2. Anonymous Coward
      Anonymous Coward

      Re: They had me right up 'til

      "They wanted my first name, last name, phone number, email, password, password, security question, security answer."

      Really, Mr. Michael Mouse, disposable@yahoo.com, PAYG burner SIM, Pass1word, pass1word, Mother's maiden name, Schicklgrueber, I don't see the problem.

      1. This post has been deleted by its author

  15. Will Godfrey Silver badge
    Thumb Down

    Carrot too small

    Would any really smart programmer actually want a 'smart' TV?

    I might have been slightly interested if the competition itself was a single interesting challenge you could really get your teeth into.

    P.S. and I say that as a not particularly good programmer.

    1. This post has been deleted by its author

      1. Will Godfrey Silver badge
        Happy

        Re: Carrot too small

        Thanks for that. Good point.

        It might fit very nicely in my not particularly good front room.

  16. Anonymous Coward
    Anonymous Coward

    Read Q1 more carefully...

    The size of the input file is not specified, so it could be arbitrarily long. We are also told that the input is entirely validated (i.e. it is a number that has a !, or it is #).

    In terms of space, therefore, potentially the most efficient way to do this is to calculate the factorials on the fly but store each result that is calculated for reuse. Thus if the input file doesn't include all the numbers from 1 to 15, we don't do as much calculating.

    To deal with arbitrarily long input files the output stream and the input stream need to be independent, so the program looks like this:

    1. Start program.

    2. Listen on input stream. If a # is received, close.

    3. Otherwise read the number and check if the factorial is already calculated.

    5. If not, calculate factorial, store in the calculated lookup.

    4. Output it on the output stream with a trailing CR.

    5. Go to 2.

    or

    1. Start program.

    2. Listen on input stream. If a # is received, close.

    3. Otherwise switch on the number and output the result on the output stream with a trailing CR.

    4. Go to 2.

    The second version could be easily implemented in a PIC with serial input and serial output, because it uses no arithmetic at all. Why you might want to I have no idea.

  17. OrneryRedGuy

    Bummer

    From your descriptions, it sounds like *had* I entered, I'd have been disappointed quite quickly. Still, the TV sounds quite craigslist-able and there's always the chance of being offered a cash-equivalent option.

This topic is closed for new posts.