@namark I really do wish I could run the code :(
I usually try not to involve I/O in the problems as that can just add an unnecessary layer of complexity to most things.
So, let me ask, the line that says
A + B = K ... does that generate a whole bunch of things like (1 + K-1) (2 + K-2) (3 + K-3) and so on?
If that is the case, what does it feel like if your list of numbers are large? Like 1,234,567,890?
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.
https://git.qoto.org/Absinthe/sum-of-number-in-list/blob/master/README.md
My code to solve it, though not clean and delicious, is in that same repo, but certainly give it a crack before peeking. :)
I get you. Remember that was a freebie :) I do like to frame them in interesting story lines if possible. However, it is a base algorithm that one should be able to pull out of one's head. Not sure a great reason to write one, other than the exercise itself. Watching something you knock out in 10 minutes be able to sort the heck out of stuff is kind of cool. And as you print out the passes it is cool to see the values bubble through.
@freemo if that is too easy, then start with them in randomized order. :)
Here's one I found for you :) I was looking through some and it seemed like it might be too much to ask for a fresh beginner, but I will be giving it a try, though I haven't quite yet.
The number 1 2 3 4 5 6 7 8 9 can have either the operator "+" or "-" placed between them, as well if no operator is placed then the adjoining numbers go together such as 1 2 would become "12" or 1 2 3 would become "123" and so forth. The goal is to find the combinations that would make the line calculate up to 100 exactly.
Here is an example: 12 + 3 - 4 + 5 + 67 + 8 + 9 = 100
There are more to be found.
@namark
Imagine a deck of cards numbered from 1 to some number. They are dealt out
one after the other in a straight line down the street. You grab the first card that is at the top of the road and if it is the same of less than the next you put it back down and grab the next one. If it is more than the next one you make them switch places. Then from that position, you continue
the same way until you get to the end of the street. If you have done no changing of places your deck is sorted. If you have done even 1 changing of places you start over from the top. Keep doing this until you make no
changes.
It is called a bubble sort, because it looks like values bubble up through the list until they come to rest at their respective positions. It is the simplest sort to write. And it works great for things that are almost sorted. Not quite as well for things that are in the completely reversed order. There are some things you can do to make it more efficient.
@nergal give me an example of how.. As it is, I am putting these here on Mastadon, as well at Twitter, and FB. But if there is a better way, help me set it up. But if it is too much trouble to set it up people won't bother.
@alex I would lean towards the squash because it is pollinated by bees. But even though idealistic vegans will not eat the product of bees as honey, they don't seem to mind partaking of the fruits of their pollination efforts.
How about a guessing game? Or job interview type programming tasks?
@nergal I can go super simple like "Create a Program that accepts 2 numbers and returns the Sum" or "Reverse a string" or "Towers of hanoi" things like that. "Dice toss" or "Card Deck Shuffle" ... just looking for what 1. won't be too easy for those with some experience. 2. Won't be too hard for someone new 3. Be interesting enough that people will want to try it.
@nergal @BradleySmall @yisraeldov IDK, I used cdpath in the past. Zsh does some interesting things with directory changes.
@nergal I am grasping at straws so all suggestions are welcome. I am not sure what you mean on the "etherpads". Pretty much anyone can use whatever language and development environment they like. Or are you suggesting some kind of pair programming?
FWIW, I would be thrilled to see a new programmer maybe get half-way there and ask for some help. Sometimes walking a solution together can open some doors,
@nergal at this point I am just pulling stuff out of thin air.
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.
@namark They are all hard to read/understand until you know them :) But definitely give J a peek, it is definitely one I will eventually get back to eventually.
@Ghosty @BradleySmall there are plenty of non-proprietary IDE's though. If you are stuck in Windows world, give SharpDevelop a look-see, or MonoDevelop. Otherwise Eclipse, or NetBeans, or CodeLite or Codeblocks all come to mind.
@Ghosty @BradleySmall money or the things it buys that yo might want to have in order to live :)
@BradleySmall @Ghosty Sometimes idealism is a wonderful thing. Sometimes you want to pay your bills and eat. It would all be great if we all had the privilege or luxury to just take an idealistic stand and do something because it was "right" or met with our philosophical stance on how things should be.
Morals and values can be relative, and subjective sometimes.
I have worked in the Gaming (casino gambling) industry as well as the Pornography (well known magazine) industry. Sometimes I just allow myself a little moral flexibility. I might not be the right person to ask if you are looking for moral guidance when it comes to writing software.
@zingbretsen @freemo Things that sound dirty, but aren't...
Of course, everything is dirty if you just add "...if you know what I mean..." after you say it. :D
@namark I got it to install the ROTD version, but then it wouldn't run without some other configuration stuff.
If I want procedural I will use Lisp and for logic would lean towards Prolog (though I haven't used it in way too many years)
If you like a tough language try BrainF**k
But I keep meaning to revisit the language "J" (kind of a modern take on APL) nice terse "golf coding" type language.
The green faerie