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.
ninety nine vials of mercury
https://git.sr.ht/~namark/mercury_stuff/tree/master/toys/vials.m
took me ages and is probably the worst way to do it... worth it!
#toyprogrammingchallenge #mercurylang
@Absinthe They are readable here, should be good. Let me know if you have any questions on the math
@Absinthe
This was a lot of fun decided to do the problem by hand using non brute Force techniques. Attached are all the steps I used to solve the problem including the final solution on the last page.
Total number of coconuts is 3,121 at the start. The number of coconuts they ended up with was the following: 828, 703, 603, 523, 459
If your following the pages I attached the order in which you follow them is "knowns/reduce" then "All valid values" then "final solution"
#toyprogrammingchallenge #python #lisp #c #c++ #cpp #coding #programming
Ready for the next challenge?
"5 Guys and a Bunch of Coconuts"
Here is a link to the text description of the problem.
https://git.qoto.org/Absinthe/coconuts/blob/master/coconuts.txt
That link is to the repo, and my solution is in it as well.
A comparison of the flex / style across 3 of my flex pens. The first I made myself from a 120 year old Waterman nib. The second is a stock falcon pilot, the last one is my hand customized Custom 912 (With Motishaw Spencerian modification)
What Mastodon instances do #python, #R, and #datascience people hang out on?
#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 :
https://git.qoto.org/Absinthe/bubblesort
I promise a full one is coming before the weekend is over. Still watching for anyone with one for the Ninety-nine Bottles challenge.
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 #toyprogrammingchallenge 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 #toyprogrammingchallenge or submit your attempt, or constructive coding recommendations and so forth.
Remember to use the # #toyprogrammingchallenge
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.
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.
Here's mine. I ended up adapting your solution for converting numbers to words, because it's more lightweight than the known solutions in my language of choice. Cheers.
https://github.com/patchcali/toy-programs-gpl/blob/master/beerbottles.prg
The green faerie