@billstclair No matter, just trying to understand what I was looking at. I don't run much Lisp (can you tell :) ) So I was just trying to understand what I was looking at.
@billstclair Yay, that did it. Is the bottom NIL stylistic or an abberation?
One bottle of beer on the wall,
one bottle of beer. Take one down,
pass it around... No bottles of beer.
NIL <------- That thing right there ?
@billstclair installed gcl and clisp, and apparently still I am not smart enough to run it :)
@paleBlue Did you miss that the goal was to have the numbers as text e.g. "Ninety-nine"?
@billstclair were you then able to initcap it?
@Captain time to start working on that Somali accent :)
@billstclair now I have to install the clisp interpretter. :) I was just hoping I could run it in emacs :) Looks good, but I will have to play with it later!
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)))
@freemo there are so many things I could say, all of which would offend someone :(
But since commenting on identities and things like that gets off into the weeds quickly, perhaps I will merely be annoying and correct your grammar.
"Were"
<please find the irony in this humorous>
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.
@ivesen pretty quick to get there handle your own memory allocations or file allocations.
@ivesen just use C mode. And make sure you have your compile and debugging settings right
@Ertain @fribbledom not sure i undertand what you are asking
@yisraeldov played with it when I was out of work and was applying at a place that used it. It was Lisp-y in a java flavoured sort of way
@fribbledom I can guess at things, but that's all it would be. I have read a lot about how it works, and what to do to get your stuff where you want it. I am just not sure it is worth the effort as the consumer. I get disheartened when some model follows me and she has 1 post and 2000 followers, while i was busting it to get content out and struggle around 200...
@fribbledom it's called algorithmic timestamping or something like that. IT guesses what you are interested in so that you can be better targetted with advertisement. That is one of the concepts sought to be overcome by the federated systems.
Silencing Spinster Instance for all of QOTO, CW for Length
@freemo @arteteco @alex @Surasanji @mk I get it. And though it hasn't come to that at this point, I understand your wanting to keep things safe and reasonable. I trust you will do what you feel is right, and I am here as a guest. I just felt I should let my opinion be known, in case it mattered.
It's your bat and your ball, and whatever you choose to do I will happily live with.
I trust your judgement, If I wanted drama I would have stayed on birdsite and followed the president. :)
The green faerie