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.
I think this whole Richard Stallman thing violates freedom of speech. I'm not defending what he said. I'm also not saying other people should say offensive things, I'm merely saying it's their right to do so. Just as it is the right of every one else who says at least as bad of stuff back. Any law that makes what he says illegal, makes much of what people that are against him say illegal.
Common Lisp. 14 minutes.
(defun beer (&optional (start 99))
(loop for num = start then next-num
for next-num = (1- num)
for numstr = (if (eql 0 num) "no" (format nil "~r" num)) then next-numstr
for next-numstr = (if (eql 0 next-num) "no" (format nil "~r" next-num))
for bottles = (format nil "bottle~p" num)
for next-bottles = (format nil "bottle~p" next-num)
while (> num 0) do
(unless (eql num start) (terpri))
(format t
"~@(~a~) ~a of beer on the wall,~%~
~a ~a of beer. Take one down,~%~
pass it around... ~@(~a~) ~a of beer.~%"
numstr bottles numstr bottles next-numstr next-bottles)))
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 #toyprogrammingchallenge
I will try to work in Python at least in the beginning but you are welcome to work in whatever you are comfortable with.
#toyprogrammingchallenge
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.
@freemo So on another topic. I got that python checked into my personal github and I also put it in the qoto gitlab as well. I have found no way other than manually to synch them up when I have made a change. Though I think I am done making changes. Did you want to put this somewhere? I think we were discussion starting a discourse topic on the puzzle itself.
@freemo Okay, so you are yet another tiling wm user. I work with one guy that has bought into that concept as well. However, I just don't see the benefit. What is the benefit, and how does it outweigh the massive amount of tweaking required?
Sorry I've been away, was walking around Amsterdam all weekend and configuring a fresh Archlinux install on my Surface Book 2.
Had the basic install working a few days ago but was mostly tweaking and configuring the window managers to be pretty and behave how i like. I got both i3 and qtile working with mostly all the same key bindings. Its pretty cool and looks super sexy.
@Absinthe Hmm, even better 🐝
@Captain are you searching for anything interesting?
Python 2 Sunsets in 107 Days. JPMorgan Isn't Ready https://developers.slashdot.org/story/19/09/14/2245258/python-2-sunsets-in-107-days-jpmorgan-isnt-ready?utm_source=rss1.0mainlinkanon&utm_medium=feed #python
Block me please!
Obviously, I am a very dangerous person. I ask questions to understand those who think differently from myself. I actually use some of the information I have gathered to help establish my opinions about things for which I don't have such already. If something doesn't make sense, I dig deeper to determine what I am seeing.
So yes, if what you believe is so brittle, and simply just uneducated repetition of rhetoric that you read off a pamphlet somewhere, then by all means, don't follow me. Block me. Please block me. But don't tell me about it. I don't need to know. I am not trying to change anyone's mind, or proselytize to some religious following.
I have no problem making friends with those I share differences of opinions. For years I have had many friends with whom I have had diametric opposition. If your world model doesn't allow for such things, then move on. There are plenty of people who want to live in an echo chamber with you.
@Trumpublican mmhmm, sure. Reasonable Tranny = Nazi, whatever you say. The word Nazi means fuck all in modern times because people like you compare being reasonable to slaughtering Jews. If you ask me, that is very anti-semetic of you. Stop watering down the Halucoust you absolute 2 by 4.
Magdalen and I did not get along when she was alive. At the time we crossed paths online, my views were different, I was still unaware of what's been going on. I'll be looking through her content when I can with my current point of view.
In either case, my sincerest condolences to her family, friends, and fans.
Shame on the "trans" community for celebrating her death. I don't know my opinion of her views at the moment, it's been a long time, but I do know she wasn't out to destroy anyone. Her intent was to protect women's rights. Celebrating her death sends a clear message that reveals the true colors of the "trans" community.
I have always said, no matter one's views, the death of someone who wasn't actively attacking others is off limits. Have some decency, ffs.
Some people asked me to share a lvery difficult yet simple logic puzzle that has stumped my friends. It is also my favorite interview question.
First off some background. The problem is not a trick question, as much as it may seem like one. There is no play on words, no hidden exception. Everything in this problem is exactly how it is presented and the answer doesn't rely on any slight of hand. Take this puzzle at face value.
Also **ALL ANSWERS NEED CONTENT WARNINGS** I do not want you spoiling it for others. This goes for questions and hints too.
Now on to the puzzle:
There is a room with 100 jars with lids on them all in a row. There is also a stack of papers, 100 papers each labeled 1 to 100. The papers are shuffled and one paper placed into each pot randomly.
You and your assistant are in an a joining room. Your assistant is allowed to enter the room, look in all 100 pots, and if they wish they can pick any 2 pots and switch the paper in them. They can only do this one time, they do not have to do this they can choose to also do nothing. At this point they leave the room, without talking to you.
Next, someone tells you a random number from 1 to 100. Your goal is to enter the room and open a pot tht has that number in it. You are allowed to open, at most, 50 of the pots.
Whatever process you use to open those pots must **guarantee** that by the time you open the 50th pot that the number you were given will be found. Obviously your assistant didn't know what the number is at any point.
What rules do you give your assistant, and what rules do you follow, to ensure you are successful?
@MutoShack@functional.cafe @inditoot #puzzle #riddle #riddles #puzzles #math #mathematics #maths
The green faerie