96

Thanks for voting! The selected challenge is:

Go

Task: Write a program that gets a chat room ID and fetches the number of stars for each user in the chat and then returns a sorted list of users by number of stars.

You can start working on it today - more information will follow soon.

You may submit your code to the GitHub repo but is is not required in order to participate.


We at the JS chat room want to throw short monthly challenges where everyone gets the same task in a new language/library/framework. After the last one was successful we're looking at a new challenge for December.

The idea is to learn a new technology, code something fun and share knowledge, opinions and experience. The scope is meant to be rather small. It's something one should be able to hack together in an evening of work.

Post your ideas here. Once an idea is chosen, post your solutions in the JavaScript chat room, or hang out there and examine others' solutions.

Format:

Language/Framework/Library

Task: Description here

Please try to suggest something new that it is unlikely room members already did:

Here's an example:

Scala

Task: Write a parser in scala that accepts a .json file and reads all the numbers in the file. The output is a JSON file containing all the numeric values in an array. You may not use any existing JSON parsers.

As you can see - it uses a non-JS technology (Scala) has a clear and small goal and is doable.

Voting and submitting ideas will start today and end in 5 days.

You may vote even if you're not going to participate. If you're not a room regular in the JS chat room you're welcome to join us in the challenge.

Good luck.

7
  • 29
    FWIW: I support using meta to coordinate this sort of thing because it reduces the isolation otherwise inherent in chat: folks can learn the rules for participation without having to have spent the past n months lurking in the room. For better or worse, chat is a part of Stack Overflow - therefore, questions regarding the rules and traditions of chat are nominally on-topic here. Also, I cleared a bunch of mostly-irrelevant comments here; if you're interested, see Félix's chat link.
    – Shog9 Mod
    Commented Dec 1, 2014 at 18:12
  • 3
    Let us continue this discussion in chat. Commented Dec 2, 2014 at 20:37
  • @Shog9: You support using meta for this only because there's no other place to put it that isn't chat?
    – tmyklebu
    Commented Dec 3, 2014 at 4:27
  • 2
    No. If you want a longer explanation than what's in the comment above, ask a separate question @tmyklebu.
    – Shog9 Mod
    Commented Dec 3, 2014 at 4:28
  • 1
    @Kendra I feel dumb, I didn't fully read Shog's comment. Felix's chat link explains it well enough, I do agree the comments were kind of getting out of hand. I'll remove my comment, derp. Commented Dec 3, 2014 at 22:01
  • 1
    Is this a codegolf.stackexchange.com topic collection or something ?
    – TLama
    Commented Dec 4, 2014 at 9:49
  • 4
    I followed the right sidebar link here, to be somewhat surprised that JS Room's monthly challenge is neither monthly nor in JavaScript. That is, of course, fine: thank you for organizing it.
    – dcorking
    Commented Dec 5, 2014 at 14:44

12 Answers 12

44

Go

Task: Write a program that gets a chat room ID and fetches the number of stars for each user in the chat and then returns a sorted list of users by number of stars.

1
34

Erlang / Elixir

Task: Write a simple calculator (Polish notation, infix, reverse-screw Hungarian, whichever you'd like). Should implement at least addition, subtraction, multiplication, division, modulo and power. If the result is an integer, query Numbers API for some interesting trivia (being interesting optional).

(Note: You can assume nicely given input, so don't stress too much on parsing. e.g. 10 * 8 and not 10*8)

Edit:

Erlang references:

General help on creating a calculator:

3
  • 5
    I gotta tell ya, being a hungarian, I'm quite offended by "reverse-screw Hungarian".... nah, just kidding! name it however you like it :) Commented Dec 3, 2014 at 10:38
  • No offense but the I would like to learn anything but Erlang at this time. I have never seen an add whereby Erlang/Elixir was up on the job market. It seems a time-waste in a practical sense.
    – samayo
    Commented Dec 3, 2014 at 22:19
  • 15
    @samaYo While the market for Brainfuck, LOLCODE and Shakespear programmers is in a constant inflation! It's not about learning something practical, the challenge is to challenge you to learn something new and different. Practicality optional.
    – Zirak
    Commented Dec 3, 2014 at 22:21
26

Dart

Task: Create an interface for suggesting and voting on monthly challenge ideas. I originally said this on the chat as a joke, but it seems within the difficulty target, and would let us avoid opening Meta questions each month that routinely get put on hold.

Front-end only, with a mock REST API for the backend. (Actual backend would be need to be implemented separately... or perhaps next month?)


(I'm open to other languages than Dart if we want this task but not the language; it's just something that's been on my list of things to try for awhile)


EDIT: please only upvote this if you think it would actually be a good programming challenge; not simply because you don't want this thread here.

3
  • I think this is kind of abusive since it'll get upvotes from people who don't like the thread here. Commented Dec 1, 2014 at 19:23
  • 1
    I mean, we could always just ask people not to upvote this just because they don't like this thread here.
    – Retsam
    Commented Dec 1, 2014 at 19:25
  • 1
    @BenjaminGruenbaum wouldn't it be in fact the best challenge that could be accepted this month? People genuinely interested in this being repeated over the months will have an interface to push the concept further, and people not wanting this here will not see it here :). there's a drawback: probably less people would see that interface compared to having a question on meta per month... Commented Dec 2, 2014 at 20:15
19

Brainfuck

Task: Write a program that chooses a random number from 1 to 100. The user then attempts to guess this number. After each guess the program tells the user if his/her guess was bigger or smaller than the correct number, or correct. Finally, the program should tell the user how many guesses he/she took.


Random number generation

Since brainfuck doesn't have good ways of seeding the random number generator, it's enough that the numbers are seemingly random the first time the program is run - that is, it's okay to generate the same numbers on the second run. The numbers may not, however, be hardcoded. They must be generated in a way that a (normal) human cannot predict the generated numbers.

A valid way of seeding the random numbers, and I actually recommend doing this as a potential bonus task, is asking the user for a random seed. The user may then proceed to faceroll his/her keyboard, and the program uses the input as the random number generator's seed.


A very simple program, however I think brainfuck in itself will f**ck your brain. Learning the language is the easiest task imaginable, but looking at it and understanding the code is very intimidating.

18
  • This sounds fun Commented Dec 2, 2014 at 15:19
  • 6
    @BenjaminGruenbaum we'll see :D Commented Dec 2, 2014 at 15:20
  • What's wrong with good old fizzbuzz? codereview.stackexchange.com/questions/57382/… Commented Dec 2, 2014 at 16:30
  • @SimonAndréForsberg Sure, that works too. Well not now really since you linked an implementation... Commented Dec 2, 2014 at 17:35
  • For the record: I have been tempted at making a high/low guessing game as well. Just haven't done that yet. Commented Dec 2, 2014 at 17:36
  • @SimonAndréForsberg And now you have an excuse! Commented Dec 2, 2014 at 17:38
  • 4
    Better yet, change the number after each guess.
    – Robbert
    Commented Dec 2, 2014 at 22:13
  • 1
    @Robbert now that's just mean Commented Dec 2, 2014 at 22:14
  • 5
    @Robbert, that's pure evil, I like it. Commented Dec 3, 2014 at 5:05
  • 1
    And who did not write this program when they learned programming? I remember my algorithm teacher having us write this program before he explained to us what binary search was.
    – Lundin
    Commented Dec 3, 2014 at 14:17
  • Good luck generating random numbers in a language without random number generator (as deterministic as it gets).
    – null
    Commented Dec 3, 2014 at 14:18
  • @xfix You do realize most languages simply have libraries that support pseudo-random number generation? With brainfuck you just have to code it yourself. This was the first thing I found googling: link Commented Dec 3, 2014 at 14:21
  • @OlaviMustanoja: You would need to seed the initial seed somehow, which is pretty much impossible, however. If you read the example, you will notice you need to define seed. You cannot use random number generator for generating seed, because it wasn't seeded. Using the same seed will make the random number generator generate the same numbers.
    – null
    Commented Dec 3, 2014 at 16:39
  • @xfix so what's the issue? I didn't say the numbers can't be the same, only that they should be seemingly random Commented Dec 3, 2014 at 16:46
  • @xfix actually I didn't... Anyway a pseudorandom number is enough. Commented Dec 3, 2014 at 16:50
14

R

Plot out when the plot thickened given a vector of dates (or timestamps). Also plot out a histogram (or whatever) of how many times different people recognised the differing thickness.

Bonus "points" for fetching and parsing the data yourself.

(If you're interested: very quick intro to R ; an awesome book on R (you may be able to find it online cough cough) ; for most everything else, ?funcName in the R repl)

5
  • "you may be able to find it online cough cough" Are suggesting that people should violate Mr. Dalgaard's/Springer's copyright and obtain that book without paying for it?
    – nobody
    Commented Dec 1, 2014 at 23:39
  • 3
    More like - it's also available in ebook format springer.com/mathematics/probability/book/978-0-387-79053-4 Commented Dec 1, 2014 at 23:59
  • 5
    Man you should get that cold checked out, Zirak, sounds bad.
    – Retsam
    Commented Dec 2, 2014 at 15:52
  • 2
    Can you please explain what the plot thickened means? It looks like a meme or a private joke from this chatroom.
    – A.L
    Commented Dec 3, 2014 at 1:00
  • @A.L A combination of this quote with this comic. It somewhen became a gag of sorts (by...erm...someone cough cough)
    – Zirak
    Commented Dec 3, 2014 at 22:14
9

Bash

Task: Write a engine can translate text in markdown format to html. Can translate bold, italic and code tags.

3
  • Sorry, but I already know Javascript so I'm downvoting this. Commented Dec 2, 2014 at 10:06
  • Sorry benjamin-gruenbaum. I read "JS Room ...." title and think that using js to do some task. So now I change my suggest from Javascript to Bash. I saw my teacher using bash to solve "Ping-pong" kata. So how if we using bash to solve my old suggest? Commented Dec 2, 2014 at 10:11
  • Upvoted - this sounds more interesting. Commented Dec 2, 2014 at 15:32
4

Famo.us

Implement Pong using the Famo.us API only (that is, no HTML in the body). I know this is JavaScript, but AFAIK Famo.us is a new technology, as such matching the requirements.

1
  • This is a perfectly fine challenge. It's ok to have a JS challenge that uses a new library. Commented Dec 2, 2014 at 18:02
1

XQuery

Task: Read in the factbook.xml and display for each country in the world the population of this country and the difference in the number of inhabitants compared to all its neighboring countries. Based on the estimated population growth (and the assumption this number is steady for the next ten years), also return how much the difference will grow/shrink.


For all JS folks out there as a reminder that there still is XML in this world and although it is not as cool as Json, it can do very nice things. XQuery is a functional language intended for processing XML. I would restrict this to XQuery 3.0 (the most current spec), which has nice higher order functions and lots of functional features. Popular Implementations are eXist or BaseX (full disclosure: I am a member of BaseX).

1

Shakespeare

Task: Write a program to calculate the factors of an arbitrary number and display them in a sorted list. Goals should be readability and brevity of the source (which will resemble an amateurish play).

While Shakespeare isn't truly a practical language, it does force the programmer to deal with more esoteric concepts and understand what is actually driving the code to work, as opposed to learning the ins-and-outs of a framework.

6
  • 1
    Wow, did not know SPL existed. I want to try it, but trying to run the makefile results in errors for me. Does it compile for you?
    – Some Guy
    Commented Dec 3, 2014 at 13:56
  • Mindblowing. I could spend a lot of time playing with that. Commented Dec 3, 2014 at 14:21
  • @SomeGuy Compiled fine for me, but I already had all the compiler's dependencies. You might want to check out this post: stackoverflow.com/questions/16050362/… Commented Dec 4, 2014 at 4:27
  • I do have the dependencies. Seem to get errors about undefined references to 'yylineno' in grammar.tab.c
    – Some Guy
    Commented Dec 4, 2014 at 13:33
  • @SomeGuy Sounds like you're running into an issue with your Flex dependency, as yylineno is a module within Flex. I'd give it a go reinstalling to see if that fixes your problem. Commented Dec 4, 2014 at 18:04
  • Thanks. I reinstalled but it didn't work. It did after I ran make clean in the root directory, though. There are still problems with the translated code, sadly :/
    – Some Guy
    Commented Dec 5, 2014 at 10:07
-2

Since it's last month's ex aequo answer:

Ada

Task: Write an IRC client. It can be a simple bot answering !!bot with Yes, I'm a bot!. It does mean implementing the IRC protocol. A simple way to understand how it works is using irc over telnet.

-5

LOLCODE

Write a short POP3 Client that fetches the last mail available on the Server and stores it into a local file. The Client doesn't need to support any encryption, plain text connections are enough (feel free to support it anyway).

-11

CraftyJS

Task : Use crafty.js in conjugation WebkitSpeechRecognition api to copy a simple SIMON so you basically speak :P as you press too fun for kids. (So basically you speak what you want your card to perform)).

4
  • 5
    WebkitSpeechRecognition might make an interesting challenge, crafty.js might make an interesting challenge, but both together is too much I think. (And the problem itself sounds beyond the "single night of work" criteria)
    – Retsam
    Commented Dec 1, 2014 at 2:19
  • @Retsam its pretty single night of work. WebkitSpeechRecognition is pretty straightforward, it is an event stream, talking about the rest of it meh I'd probably be able to do it in single night or maybe 2 but oki ^_^ i get what you are sayin :-) Commented Dec 1, 2014 at 8:00
  • 2
    What if i reduce the challenge from crafty pokemon to just SIMON ? Commented Dec 1, 2014 at 8:01
  • 2
    So your challenge idea is what? Designing a card game or using WebkitSpeechRecognition? I don't think it is an appropriate challenge the way it is presented at this moment. Something simple like Simon makes more sense to me because the point of this challenge is not to invent a card game but to use new technologies. So the challenge should be a well defined idea to be implemented and not so much a general thought to be expanded on.
    – user1596138
    Commented Dec 1, 2014 at 14:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .