Show more

Here's another freebie!! I signed up for a programming problem of the day. I got my first one today, rated "easy".

Here's the description of the problem.

git.qoto.org/Absinthe/sum-of-n

My code to solve it, though not clean and delicious, is in that same repo, but certainly give it a crack before peeking. :)

How about a guessing game? Or job interview type programming tasks?

Okay, I thought I came up with some good challenges and a fun freebie to go with them. I seem to be getting some followers, but not a lot of people trying them.

What kinds of things are you all interested in? I can find all sorts of things, many of them are math-y (statistics and things like that), or string management and still others require you be willing to handle things like differential equations.

If you mention what you might like I can either find some or make some up.

++

Ready for the next challenge?

"5 Guys and a Bunch of Coconuts"

Here is a link to the text description of the problem.

git.qoto.org/Absinthe/coconuts

That link is to the repo, and my solution is in it as well.

Here is a freebie, but I encourage you to give it a try.

I remember back to first year college. Prof said, some day your boss will come to you at 3:15 and ask you to write a sort module and he will need it by 3:30. The answer to this was the bubble sort. the idea being that it might not be the most efficient or elegant sort module, but sure enough it is easy to write. I have been working in the industry since 1989 and to date, no one has ever asked me to write a sort routine. :)

That said, I challenged myself to write one in 15 minutes, in python because I am trying to relearn python. It took a little longer than 15 minutes, but I did comment it, comply with pylint3 and pycodestyle. And I refactored it for modularity.

Give it a shot, see if you can do it without looking it up. It is an awesome feeling when it works.

If you want, here is my results :

git.qoto.org/Absinthe/bubbleso

I promise a full one is coming before the weekend is over. Still watching for anyone with one for the Ninety-nine Bottles challenge.

@bii @paleBlue @billstclair

Is anyone else interested in the current challenge, before I get ready to drop the next one?

I have shared the first one with some friends outside the fediverse and got some good reaction from them as well.

If you have some friends that might be interested please pass it along. I am not sure how well the tag federates so as I see that people have responded I will try to keep a list and keep you in the loop. If anyone is just interested in watching, either follow the or submit your attempt, or constructive coding recommendations and so forth.

Remember to use the #

Unfortunately, I see no way to follow a tag, but as long as you remember to include the tag in your post all that gets posted against it will be searchable at least.

I am still looking to see more languages, and/or feedback on the entries we have so far. Also, anyone you know that is interested feel free to share it with them.

By the way, I updated my attempt to have a cleaner output by building up a tuple to pass to the print statement so I didn't need multiple output lines.

And thanks @freemo for the gitlab space.

git.qoto.org/Absinthe/ninety_n

I want to propose a programming challenge. This could be fun for beginners and experienced programmers as well. It is language agnostic. It might even be more about community than the programming part itself. The challenge itself should not take more than an hour. But it shouldn't be so simple that you don't have to put in a little effort. I will propose the first one, and those who participate are welcome to propose the next and as we can agree on it we can go off and knock it out.

Once you see other people's results you can modify your own, or even propose something to make someone else's better or faster or fix a bug that you find.

These can become toy programs for you to have around for testing concepts, and helping to try out other languages.

If you are interested or know someone else who might want to play too share this with them.

I guess we can use this thread to get started, and I guess i am supposed to use a hashtag for something like this so how about

I will try to work in Python at least in the beginning but you are welcome to work in whatever you are comfortable with.


First challenge:

"Ninety-nine bottles of beer on the wall"

Generate the whole song from "Ninety-nine" to "No". The output should look like :

Ninety-nine bottles of beer on the wall.
Ninety-nine bottles of beer. Take one down,
pass it around... Ninety-eight bottles of beer.

(You know what the middle looks like)

Two bottles of beer on the wall.
Two bottles of beer. Take one down,
pass it around... one bottle of beer.

One bottle of beer on the wall.
One bottle of beer. Take one down,
pass it around... No bottles of beer.

I won't put too many specifics on how you get there, but the output should be words, not numerals :) Try to write clean, maintainable and visually understandable code.

Let see if I am alone or anyone wants to play along. :)

Here is my first attempt total time 48 minutes.

git.qoto.org/Absinthe/ninety_n

Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.