Show newer

#python #toyprogrammingchallenge

It doesn't have to be Python, but I am doing it in python. I would appreciate any feedback on my solutions, and encourage everyone interested to submit their solutions.

I will try to post one each week. But I make no promises.

So far there is one to generate the the lyrics of Ninety-nine Bottles of beer (without numerals and with correct pluralization of the word bottle(s) ).

This is coming from @Absinthe So either follow that account, or the hashtag

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.

@gnomon sure. This is a fine medium and timing is whatever.

@gnomon I would love to be better with git. Especially after trying to get the submodules working with my vim plugins yesterday

@remulacfrommars you know, if life gives you melons.... You might just be dyslexic.

@mngrif I know there were flags for PIC vs PIE Position Independent Executable and something else. I know it was a flag I had to make sure to use at one time... Wasn't sure it was a LD flag or not,

@mngrif so I am assuming that you are compiling a source. s because you started with a source.c and compiled it with gcc -S

I am further guessing you called something like printf() or puts() in the source.c file.

You need to pull in the c library, so using gcc -o source source.s will be your friend.

gcc -S hello.c
gcc -o hello hello.s
./hello

@mngrif That pile of commands doesn't even work on Linux, I just tried it

@mngrif you should be able to use gcc but don't mind me, I don't work on Powerppc.

@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 #

care to play with some programming languages:

Here is a web page that lets you have a compillation environment for a whole bunch of them without having to install anything. Pick your language from the drop down.

rextester.com/

@freemo I see your pinning idea works ok over on LinuxRocks, but not on this instance. I guess the UI here (which I prefer) is different OOB

@freemo I only have one column. When I click on Home, Notifications, Local etc... it changes what is shown in that column

@freemo so it is not as simple as just following it like you would a person?

@Absinthe

Haha, yeah, yeah :)

Heck, with support for Windows 7 and 8 ending soon, there'll soon enough come a time when *I* won't be able to run it either. [stage whisper] "that's why I'm learning python..."

But VFP served my career well for twenty-some years, and it does still run on a lot of machines.

It's the language & dev environment I'm still most familiar with, though I hadn't touched it in a while, so I saw this as an opportunity to fire up the ol' IDE again.

Show older
Qoto Mastodon

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