Announcement
· Dec 4, 2018

Win Advent of Code 2018 and Get a Ticket to InterSystems Global Summit 2019!

Hi Everyone!

As you know Advent of Code 2018 is in full swing! Till the 25th of December 2018 each day 2 programming problems to sharpen your programming skills! 

And now we're ready to present great prizes for Members of InterSystems Global Masters Advocate Hub!

Win Conditions: To win our prize you should be on the top of ObjectScript Leaderboard and upload all the solutions in a public repository and present the code in InterSystems ObjectScript in UDL form. The example of the repo.

Prizes: 

        → 1st Place: 10 000 points on Global Masters and FREE registration & hotel accommodation for the next InterSystems Global Summit 2019 [!!!]

        → 2nd Place: 5 000 points on Global Masters

        → 3rd Place: 3 000 points on Global Masters

Note: Don't forget to use our own InterSystems Leaderboard, with the code 130669-ab1f69bf or the direct link.

Good luck to all of you! yes

Discussion (37)4
Log in or sign up to continue

What I have seen happen a few times allready is that people from our leaderboard just copy the solution from another person in another language and submit the results without having done any coding at all. 

For example day 7 
last solution to fill top 100: 00:30:52

fastest solution part1:    00:09:27
fastest solution part2(after doing part1): 00:03:34

Someone on our leaderboard got this:
solution part1: 00:39:16
solution part2: 00:00:13

He did the second part in 13 seconds while the fastest person on the leaderboard took 3 minutes and half to do it. The second solution took quite a bit of programming and the 100th player to finish star 2 needed allmost 10 minutes. Someone on our leaderboard: 13 seconds.

This means he just copied a solution from another player, put in answer 1, after that was accepted he inserted answer 2 and submitted again.

Clearly because a big price is involved people resort to playing unfairly.

I only see 2 ways to fix this:
- Remove players who have been caught cheating
- Let all people post their public repository on here and after each star rerquire them to push their solution to that repository.

This doesnt stop people from copying from other players in our competition but at least forces people to use Caché. Blantant copying will still be spotted because the code will resemble another competitors code. Also this will make it so that a copying person cant win the day anymore cause he will have to wait for at least one other caché player before he can start copying.

What are your thoughts on this?
 

Hi Bert!

I think you are right twice. First, no one can stop cheating in the world and the second no one can win this contest with cheating. And of course no one can stop copy-n-paste in coding :) On the other hand, there is a chance to know something new even with copy-pasting.

As a community manager, I would love to see more open repositories with ObjectScript and I like what we had last year - the open discussion of Advent of Code problems solved with ObjectScript. Thanks for sharing your repo! 

Speaking about the prize it's clear that it can be interesting only to people who develop with InterSystems Data Platforms and I believe this is the key motivation to win.  

As we see it now the competition is active and healthy, we don't plan to change any rules but encourage the fair play.

Submitted code is not public by default.

Players get different inputs for puzzles.

All timings are calculated from the moment the puzzle is published, not the moment you start working on it.

Assuming fastest coder would publish the code, finding it and rewriting it is going to take time.

Moreover fastest solutions usually use, let's say, advanced language-specific concepts, so starting from scratch could often go even faster.

Bert,
I'd be curious where you get the data points from, I haven't been able to see other people's times. Also keep in mind, sometimes the way you do a solution is a maker/breaker on how quickly you get the second part. Day10 was another great example for that.
I don't think you're accusing me of this since it took me more than 16 minutes to get from part1 to part2 on day7. But just in case you're doubting, here's my code: https://github.com/kazamatzuri/AoC/tree/master/AoC/User
And yes, I did day 2/3 in python ...

I am not accusing you of anything Fabian, on the contrary your results seem to show you are creating solutions yourself.

The data points can be found here: https://adventofcode.com/2018/leaderboard/private/view/130669.json
You can view the results for yourself. Nice visualiser for the results:  https://mcpower.github.io/aoc-leaderboard-viewer/

I would also be very cautious of trying to make judgements based on the way people implemented things. For some of the puzzles there are very clear 'best solutions' and one would expect people with the necessary training in data structures/algorithms will simple go with a similar implementation because 'that's the way you solve a problem like that'. I'm sure once we get to harder problems that might change, but for these beginning problems there isn't a good way to fix this.

I decided to participate too!

Here is my repo.

And here is a short "Coding talks" Video on how to code Advent of Code and use Github and VSCode.

 

https://www.youtube.com/embed/GyFJ67jqXCU
[This is an embedded link, but you cannot view embedded content directly on the site because you have declined the cookies necessary to access it. To view embedded content, you would need to accept all cookies in your Cookies Settings]

COS has some nice features, but most of the time it is lacking basic functionality that would make us competitive in these types of contests.
On top of that, there are no libraries, so you always have to code everything from scratch. Which has a certain appeal to it, but will not not get us close to the leaderboard. The closest I got was place 137 on day22, part2.
Given that mumps/COS only supports the most basic constructs and lacks any modern influence of programming tools, there isn't all that much we can do about that ;)

Congratulations Fabian and Bert for completing all of the challenges.

It's 5am when the challenges open up here so its hard to compete, but I think I would still be far behind some of the times that you have been achieving.

Plus I get a little side tracked with the challenges, I've been learning Python this year so its been interesting looking at Python solutions after I've done it in ObjectScript. The code is always much more cleaner and compact. It got me thinking on day 6 about building helper libraries specific to the competition. I ended up with a solution that looks like this...

ClassMethod Day6()
{
    set file=$$$file("C:\aoc\day6.txt",.sc) $$$QuitOnError(sc)
    set matrix=file.ToMatrix(", ")
    do matrix.Min(.minx,.miny)
    do matrix.Max(.maxx,.maxy)
    for x1=minx:1:maxx {
        for y1=miny:1:maxy {
            set min=""
            while matrix.ForEach(.key,.x2,.y2) {
                set dist=$zabs(x1-x2)+$zabs(y1-y2)
                if dist=min set nearest="."
                if (min="")||(dist<min) set min=dist,nearest=key
            }
            set count(nearest)=$get(count(nearest))+1
            if (x1=minx)||(x1=maxx)||(y1=miny)||(y1=maxy) set infinite(nearest)=""
        }
    }
    set most=0
    set key=$order(count(""))
    while key'="" {
        if '$data(infinite(key)),count(key)>most set most=count(key),hasMost=key
        set key=$order(count(key))
    }
    return count(hasMost)
}

I then got very side tracked on day 7 and started looking at transcompiling Python to ObjectScript. I managed to use Pythons own AST library to parse Python and push it into a global Mumps tree so I could tinker around converting Python to ObjectScript. Turns out the two languages are very compatible, unlike JavaScript which I gave up on a few years back. The interesting thing about Python is its incredible growth in popularity over the past few years, there is a really interesting article here on it...

https://stackoverflow.blog/2017/09/06/incredible-growth-python/

But then I would just settle on a "for x in y" in ObjectScript...

My top place by day was 242 on day 8 (that was the only day that I actually did the puzzle at midnight though - I'm not at all a night owl).

My three wishes for ObjectScript would be:

  1. A greater variety of high-performance data structures with low-level support (rather than shoehorning everything into a local array/PPG/$ListBuild list to keep it wicked fast, or building more expensive objects that do exactly what I want)
  2. Libraries for working with those (and existing) data structures (or, better yet, an OO approach to everything, similar to %Library.DynamicArray/%Library.DynamicObject)
  3. Functional programming capabilities

Here is the final Leaderboard for the contest is:

1st place - @Fabian.Haupt

2nd place -@Bert.Sarens

3rd place - @Dmitry Maslennikov

Congrats to winners and to all the participants!

We'll provide all the prises shortly and would appreciate if you share your repos (a lot of participants already did).

It would be great to know how people solve the same tasks with ObjectScript independently. Thanks in advance!

Sorry, Alexey )

They are clickable for real but on the leaderboard pages. Here is the ObjectScript leaderboard, which you can join if you register on Advent of code site with email - and you'll have normal "white" name, and "green clickable one", if you join via Github or any other applicable for Advent site OpenID provider.

E.g. see the overall "world-wide" leaderboard which is available without authentication.