* Re: Advent of Code
2020-11-28 3:12 Advent of Code John Perry
@ 2020-11-28 18:40 ` Stephen Leake
2020-11-29 3:36 ` Jeremy Grosser
` (5 subsequent siblings)
6 siblings, 0 replies; 36+ messages in thread
From: Stephen Leake @ 2020-11-28 18:40 UTC (permalink / raw)
John Perry <john.perry@usm.edu> writes:
> Does anyone know about Advent of Code, and has anyone ever
> participated for Ada? It's typically a sequence of programming puzzles
> posed as an Advent calendar: one for each new day.
>
> https://adventofcode.com/2020/about
Thanks for the heads up. I'll give it a try, but one a day may be too
much for me.
--
-- Stephe
Written from unceded ancestral homelands of the Huichiun, an Ohlone
people,for which I pay Shuumi Land Tax
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: Advent of Code
2020-11-28 3:12 Advent of Code John Perry
2020-11-28 18:40 ` Stephen Leake
@ 2020-11-29 3:36 ` Jeremy Grosser
2020-11-29 14:03 ` Bojan Petrovic
` (4 subsequent siblings)
6 siblings, 0 replies; 36+ messages in thread
From: Jeremy Grosser @ 2020-11-29 3:36 UTC (permalink / raw)
On Friday, November 27, 2020 at 7:12:23 PM UTC-8, john....@usm.edu wrote:
> Does anyone know about Advent of Code, and has anyone ever participated for Ada? It's typically a sequence of programming puzzles posed as an Advent calendar: one for each new day.
>
> https://adventofcode.com/2020/about
>
> Older examples are here:
>
> https://adventofcode.com/2020/events
>
> I had thought of it, but I don't have too much time. Some languages maintain their own mini-communities and leaderboards, and it might be a way to raise Ada's profile (or even SPARK'S?).
>
> john perry
I did Advent of Code in Ada last year. I got distracted by other projects and didn't finish it, but found it to be a very good way to learn with focused problems. My solutions are up on GitHub if you're curious, but knowing what I know now, they're far from optimal and some parts are definitely in need of refactoring.
https://github.com/JeremyGrosser/advent
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: Advent of Code
2020-11-28 3:12 Advent of Code John Perry
2020-11-28 18:40 ` Stephen Leake
2020-11-29 3:36 ` Jeremy Grosser
@ 2020-11-29 14:03 ` Bojan Petrovic
2020-12-01 7:08 ` John Perry
` (3 subsequent siblings)
6 siblings, 0 replies; 36+ messages in thread
From: Bojan Petrovic @ 2020-11-29 14:03 UTC (permalink / raw)
John Perry <john.perry@usm.edu> writes:
> Does anyone know about Advent of Code, and has anyone ever participated for Ada? It's typically a sequence of programming puzzles posed as an Advent calendar: one for each new day.
>
> https://adventofcode.com/2020/about
Hi,
I solved a couple of challenges from the last year's AoC in both Ada and
Rust, just to get a feel for the differences between them in a puzzle
solving context:
https://github.com/ALPHA-60/advent-of-code-2019
I've been organising a weekly recreational coding workshop at my company
for the last couple of years, and we've been solving Project Euler and
Codility task. I stopped doing it in March because of the Covid-19
situation, but we'll reboot it online on December 1st, when AoC 2020
starts, though our schedule will remain the same - one AoC problem
per week.
A while ago we did some interview question exercises on #Ada Telegram
group, so maybe we can do it again there.
Regards,
Bojan
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: Advent of Code
2020-11-28 3:12 Advent of Code John Perry
` (2 preceding siblings ...)
2020-11-29 14:03 ` Bojan Petrovic
@ 2020-12-01 7:08 ` John Perry
2020-12-01 11:37 ` Max Reznik
` (2 more replies)
2020-12-01 18:33 ` Per Sandberg
` (2 subsequent siblings)
6 siblings, 3 replies; 36+ messages in thread
From: John Perry @ 2020-12-01 7:08 UTC (permalink / raw)
Well, the first day wasn't too bad. It took me an hour, mainly because I'm not as familiar with Ada as I'd like. Once I re-learned file input & remembered the declare clause, it was quick.
I'll follow Jeremy Grosser's example and post my solutions to GitHub, too.
https://github.com/johnperry-math/AoC2020.git
john perry
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: Advent of Code
2020-12-01 7:08 ` John Perry
@ 2020-12-01 11:37 ` Max Reznik
2020-12-01 11:37 ` Jeffrey R. Carter
2020-12-01 12:17 ` Stephen Leake
2 siblings, 0 replies; 36+ messages in thread
From: Max Reznik @ 2020-12-01 11:37 UTC (permalink / raw)
Someone posted on reddit:
https://www.reddit.com/r/ada/comments/k4fn9w/anyone_else_participating_in_advent_of_code/
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: Advent of Code
2020-12-01 7:08 ` John Perry
2020-12-01 11:37 ` Max Reznik
@ 2020-12-01 11:37 ` Jeffrey R. Carter
2020-12-01 12:17 ` Stephen Leake
2 siblings, 0 replies; 36+ messages in thread
From: Jeffrey R. Carter @ 2020-12-01 11:37 UTC (permalink / raw)
On 12/1/20 8:08 AM, John Perry wrote:
> Well, the first day wasn't too bad. It took me an hour, mainly because I'm not as familiar with Ada as I'd like. Once I re-learned file input & remembered the declare clause, it was quick.
>
> I'll follow Jeremy Grosser's example and post my solutions to GitHub, too.
>
> https://github.com/johnperry-math/AoC2020.git
Very simple. Took about 20 mins. Doesn't seem worth posting.
--
Jeff Carter
"Gentlemen, you can't fight in here. This is the War Room!"
Dr. Strangelove
30
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: Advent of Code
2020-12-01 7:08 ` John Perry
2020-12-01 11:37 ` Max Reznik
2020-12-01 11:37 ` Jeffrey R. Carter
@ 2020-12-01 12:17 ` Stephen Leake
2 siblings, 0 replies; 36+ messages in thread
From: Stephen Leake @ 2020-12-01 12:17 UTC (permalink / raw)
John Perry <john.perry@usm.edu> writes:
> Well, the first day wasn't too bad.
Me too; https://github.com/stephe-ada-guru/Advent_of_Code
--
-- Stephe
Written from unceded ancestral homelands of the Huichiun, an Ohlone
people,for which I pay Shuumi Land Tax
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: Advent of Code
2020-11-28 3:12 Advent of Code John Perry
` (3 preceding siblings ...)
2020-12-01 7:08 ` John Perry
@ 2020-12-01 18:33 ` Per Sandberg
2020-12-01 19:45 ` Simon Beàn
2020-12-01 20:37 ` R R
2020-12-02 20:51 ` gautier...@hotmail.com
6 siblings, 1 reply; 36+ messages in thread
From: Per Sandberg @ 2020-12-01 18:33 UTC (permalink / raw)
Just for play
https://github.com/persan/advent-of-code-2020.git
/P
On 28/11/2020 04:12, John Perry wrote:
> Does anyone know about Advent of Code, and has anyone ever participated for Ada? It's typically a sequence of programming puzzles posed as an Advent calendar: one for each new day.
>
> https://adventofcode.com/2020/about
>
> Older examples are here:
>
> https://adventofcode.com/2020/events
>
> I had thought of it, but I don't have too much time. Some languages maintain their own mini-communities and leaderboards, and it might be a way to raise Ada's profile (or even SPARK'S?).
>
> john perry
>
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: Advent of Code
2020-12-01 18:33 ` Per Sandberg
@ 2020-12-01 19:45 ` Simon Beàn
2020-12-01 20:10 ` John Perry
0 siblings, 1 reply; 36+ messages in thread
From: Simon Beàn @ 2020-12-01 19:45 UTC (permalink / raw)
Me too I want to play!
Here is mine :
https://github.com/smionean/AdventOfCode
I hope to find time to complete this year.
Simon B.
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: Advent of Code
2020-12-01 19:45 ` Simon Beàn
@ 2020-12-01 20:10 ` John Perry
2020-12-02 0:12 ` Stephen Leake
0 siblings, 1 reply; 36+ messages in thread
From: John Perry @ 2020-12-01 20:10 UTC (permalink / raw)
Given the interest in participation, is there also interest in a private leaderboard for participants using Ada?
I could go either way. On the one hand, it could motivate participation! But the leaderboard seems to operate on a "faster is better" proposition, and I while I finished this one relatively quickly (given my lack of experience), a much better program emerged after reading comments on my code (thanks Maxim and Emmanuel!) and after reading a forum for a different language, where I discovered that my code had a bug.
Also negative: I don't think there's any way to guarantee that someone used Ada. You just add yourself to the leaderboard using a code.
john perry
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: Advent of Code
2020-12-01 20:10 ` John Perry
@ 2020-12-02 0:12 ` Stephen Leake
0 siblings, 0 replies; 36+ messages in thread
From: Stephen Leake @ 2020-12-02 0:12 UTC (permalink / raw)
John Perry <john.perry@usm.edu> writes:
> I could go either way. On the one hand, it could motivate
> participation! But the leaderboard seems to operate on a "faster is
> better" proposition, and I while I finished this one relatively
> quickly (given my lack of experience), a much better program emerged
> after reading comments on my code (thanks Maxim and Emmanuel!) and
> after reading a forum for a different language, where I discovered
> that my code had a bug.
And some of us don't want to get up at midnight (in whatever time zone).
I think posting here is enough.
--
-- Stephe
Written from unceded ancestral homelands of the Huichiun, an Ohlone
people,for which I pay Shuumi Land Tax
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: Advent of Code
2020-11-28 3:12 Advent of Code John Perry
` (4 preceding siblings ...)
2020-12-01 18:33 ` Per Sandberg
@ 2020-12-01 20:37 ` R R
2020-12-02 12:35 ` Jeffrey R. Carter
2020-12-02 20:51 ` gautier...@hotmail.com
6 siblings, 1 reply; 36+ messages in thread
From: R R @ 2020-12-01 20:37 UTC (permalink / raw)
I also created my github repository for the first entry:
https://github.com/RREE/AOC_2020
Rolf
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: Advent of Code
2020-12-01 20:37 ` R R
@ 2020-12-02 12:35 ` Jeffrey R. Carter
2020-12-02 16:09 ` John Perry
0 siblings, 1 reply; 36+ messages in thread
From: Jeffrey R. Carter @ 2020-12-02 12:35 UTC (permalink / raw)
Did day 2. Again quite simple and about 20 minutes.
--
Jeff Carter
"What's special about Agile is that it's a mix of the
best and the worst."
Bertrand Meyer
148
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: Advent of Code
2020-12-02 12:35 ` Jeffrey R. Carter
@ 2020-12-02 16:09 ` John Perry
2020-12-02 16:57 ` gautier...@hotmail.com
0 siblings, 1 reply; 36+ messages in thread
From: John Perry @ 2020-12-02 16:09 UTC (permalink / raw)
On Wednesday, December 2, 2020 at 6:35:47 AM UTC-6, Jeffrey R. Carter wrote:
> Did day 2. Again quite simple and about 20 minutes.
Today's was simpler to solve than yesterday's, but I put an "exit" in the wrong part of a loop, so I got the wrong count on part one. Debugging that meant I spent as much time today as the day before.
My impression is that they grow harder as time goes on.
john perry
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: Advent of Code
2020-12-02 16:09 ` John Perry
@ 2020-12-02 16:57 ` gautier...@hotmail.com
2020-12-02 18:01 ` John Perry
0 siblings, 1 reply; 36+ messages in thread
From: gautier...@hotmail.com @ 2020-12-02 16:57 UTC (permalink / raw)
On Wednesday, December 2, 2020 at 5:09:17 PM UTC+1, john:
> Today's was simpler to solve than yesterday's, but I put an "exit" in the wrong part of a loop, so I got the wrong count on part one. Debugging that meant I spent as much time today as the day before.
Difficulty of those problems has certainly lots of subjectivity. I found yesterday's so easy that I did it in a spreadsheet (a "no code" solution ;-) )...
G.
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: Advent of Code
2020-12-02 16:57 ` gautier...@hotmail.com
@ 2020-12-02 18:01 ` John Perry
0 siblings, 0 replies; 36+ messages in thread
From: John Perry @ 2020-12-02 18:01 UTC (permalink / raw)
> Difficulty of those problems has certainly lots of subjectivity. I found yesterday's so easy that I did it in a spreadsheet (a "no code" solution ;-) )...
I wish I'd thought of that.
I likely could have solved both problems much more quickly in one of the languages I work with routinely, which sadly enough are not Ada. With Python I might even have finished it in a handful of minutes. But doing it in Ada makes it interesting, and so far it's been more pleasant than I expected. :-)
john perry
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: Advent of Code
2020-11-28 3:12 Advent of Code John Perry
` (5 preceding siblings ...)
2020-12-01 20:37 ` R R
@ 2020-12-02 20:51 ` gautier...@hotmail.com
2020-12-02 21:29 ` Max Reznik
2020-12-02 22:59 ` Stephen Leake
6 siblings, 2 replies; 36+ messages in thread
From: gautier...@hotmail.com @ 2020-12-02 20:51 UTC (permalink / raw)
Thanks John for the reminder about the Advent of Code. It's lots of fun!
Just before starting with today's puzzle, I had the idea of programming the solution with HAC (and the LEA editor). The quick edition-compilation-run cycle of HAC is an advantage for this contest. However, today, I was not quick enough to get points. Perhaps another day?
Links to my solutions are at the end of the following post:
https://gautiersblog.blogspot.com/2020/12/advent-of-code-2020-with-hac-and-lea.html
G.
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: Advent of Code
2020-12-02 20:51 ` gautier...@hotmail.com
@ 2020-12-02 21:29 ` Max Reznik
2020-12-02 23:04 ` Stephen Leake
2020-12-02 22:59 ` Stephen Leake
1 sibling, 1 reply; 36+ messages in thread
From: Max Reznik @ 2020-12-02 21:29 UTC (permalink / raw)
I gathered list of GitHub repository from this topic on a page, if someone wants to see all of them in one place.
https://github.com/reznikmm/ada-howto/tree/advent-2020
I also provided mine Ada solutions as Jupyter Notebooks. You can read them in Markdown or launch in the browser with "launch | binder" button.
Have a fun :)
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: Advent of Code
2020-12-02 20:51 ` gautier...@hotmail.com
2020-12-02 21:29 ` Max Reznik
@ 2020-12-02 22:59 ` Stephen Leake
2020-12-14 17:43 ` Gautier Write-Only Address
1 sibling, 1 reply; 36+ messages in thread
From: Stephen Leake @ 2020-12-02 22:59 UTC (permalink / raw)
"gautier...@hotmail.com" <gautier_niouzes@hotmail.com> writes:
> Just before starting with today's puzzle, I had the idea of
> programming the solution with HAC (and the LEA editor). The quick
> edition-compilation-run cycle of HAC is an advantage for this contest.
On these small files, can you really tell the difference in speed
between GNAT and HAC? or (insert other favorite editor, mine is Emacs)
and LEA? for me, everything is instantaneous.
--
-- Stephe
Written from unceded ancestral homelands of the Huichiun, an Ohlone
people,for which I pay Shuumi Land Tax
^ permalink raw reply [flat|nested] 36+ messages in thread
* Re: Advent of Code
2020-12-02 22:59 ` Stephen Leake
@ 2020-12-14 17:43 ` Gautier Write-Only Address
0 siblings, 0 replies; 36+ messages in thread
From: Gautier Write-Only Address @ 2020-12-14 17:43 UTC (permalink / raw)
On Wednesday, December 2, 2020 at 11:59:23 PM UTC+1, Stephen Leake wrote:
> On these small files, can you really tell the difference in speed
> between GNAT and HAC? or (insert other favorite editor, mine is Emacs)
> and LEA? for me, everything is instantaneous.
From GNAT Studio I get a range of 1.5 sec (an i5 PC @2.9 GHz) to 9 sec (a lightweight laptop)
for building aoc_2020_12.adb (almost a benchmark for easy puzzles ;-) ).
On the same source, I run hac -v2 aoc_2020_12.adb:
Compilation finished in 0.000335500 seconds.
Part 1: Manhattan distance of the ship to (0,0): 1631 (1631.0)
Part 2: Manhattan distance of the ship to (0,0): 58606 (58606.0)
VM interpreter done after 0.008894500 seconds.
So, for this kind of puzzle, it makes a difference (correct solution to part 1 was sent at 00:11:01).
But agreed, it's quite rare.
Especially on today's puzzle, I didn't even consider using HAC...
^ permalink raw reply [flat|nested] 36+ messages in thread