26
\$\begingroup\$

In Memory of Ralph H. Baer - 1922-2014 - co-inventor of the "Simon" game.


This round is now complete!


Simon Says will be the challenge this time

  • Simon Says: +17 score
  • Resistor: +12 score
  • Calculator: +11 score

Challenge completes when Winter Bash Starts - Happy Winter Bash Warmup!

Winterbash Starting!

Here are the questions posted in response to this challenge (oldest to newest - question/answer scores at challenge-close):

All of these were well received questions, and, to my count, have added +535 question rep, +90 accept rep, and +720 answer rep. A nice 1345 total rep.

Even though the official challenge is now over, you can still ask more, answer more, and vote more on all the posts.

Enjoy your hats, everyone!


Gentle reminders that some may find helpful:

  1. do not fall victim to the 'get-it-done-fast' trap. There is no prize for the early entries, and there's almost 10 days to get it done. Frankly, if 10 days is not enough, then that's OK too, just post your code when you can. Along those lines, if any previous challenges inspire you, or you are reading this after this challenge is complete, then feel free to use 'old' ideas for inspiration too. The challenge 'window' is there only to synchronize the timing of participants so we can all discuss our progress.
  2. there are no prizes at all... just good questions and good answers. The prize is the satisfaction, and reputation, that you earn.
  3. the idea is to extend yourself in ways that you would not normally do. The challenge is just something a little inspiring, if your interest lies in only a part of it, then implement what inspires you. The advantage of the challenge here is that it gives you something in common with other people too. That makes it more fun (if that's your thing).
  4. Come and chat about things in the 2nd monitor. These are called community challenges for a reason, they help form a community. Come and join another side of the Code Review community in chat.

WinterBash will be starting in 2 weeks. Let's put up a code-challenge to complete before that. Like previous challenges, this meta post is here to poll for a good challenge idea. Here's how this round will work:

  1. Post an answer to this question with your challenge
  2. Vote for those answers which interest you
  3. At the end-of-day on Thursday, 4th December, the most-voted post will become the week challenge.

Once the challenge topic is decided, you can post questions on the main-site related to the challenge. The idea is to run the challenge all the way through to the start of WinterBash, which starts on the 15th Dec (I have been told).

\$\endgroup\$
0

3 Answers 3

24
\$\begingroup\$

Simon André Forsberg Says

Let's play a game of Simon Says! The older folks around here probably remember a game called Simon.

The Challenge

Create a UI with four colored buttons that light up in a random pattern. After displaying the pattern, the player must repeat the pattern by clicking the buttons in proper order. The pattern gets longer each time the player completes the pattern. If the player presses a wrong button, the game ends.

\$\endgroup\$
7
  • 12
    \$\begingroup\$ Somehow I can't do anything else than up-vote this. \$\endgroup\$ Commented Dec 2, 2014 at 18:14
  • \$\begingroup\$ Updated the title @SimonAndréForsberg. \$\endgroup\$
    – RubberDuck
    Commented Dec 2, 2014 at 18:34
  • 2
    \$\begingroup\$ Okay this is it! Bonus imaginary points for an on-site playable implementation that leverages the JavaScript /Stack Snippets feature! \$\endgroup\$ Commented Dec 4, 2014 at 21:45
  • 1
    \$\begingroup\$ That's what I had in mind when I suggested it. I'm hoping a javascript guru steps up to that challenge @Mat'sMug. \$\endgroup\$
    – RubberDuck
    Commented Dec 4, 2014 at 21:46
  • 4
    \$\begingroup\$ Might be worth noting that @SimonAndréForsberg likes interesting twists on his games (see the memory game and minesweeper), which probably could receive extra warm welcome ;-) \$\endgroup\$
    – janos
    Commented Dec 4, 2014 at 22:07
  • \$\begingroup\$ @janos I think I will have to try hard to come up with some nice twists on this one :) \$\endgroup\$ Commented Dec 5, 2014 at 11:33
  • 4
    \$\begingroup\$ Rest in peace, Mr. Ralph H. Baer \$\endgroup\$
    – Edward
    Commented Dec 8, 2014 at 15:13
16
\$\begingroup\$

Resistor mania

In electronics, two resistors in series have a combined resistance \$R_1+R_2\$, and two resistors in parallel have combined resistance of \$\displaystyle \frac{R_1 R_2}{R_1 + R_2}\$. Given an infinite supply of \$270\Omega\$ resistors with \$5\%\$ tolerance, write a program to describe how to combine them into any arbitrary resistance value.

Bonus points for:

  1. graphics (especially schematics)
  2. using the minimum number of resistors
  3. calculating the effective tolerance

This may help those not already familiar with the ideas: http://en.wikipedia.org/wiki/Series_and_parallel_circuits

\$\endgroup\$
2
  • 2
    \$\begingroup\$ 256Ω Would be a nicer number. \$\endgroup\$ Commented Dec 4, 2014 at 19:17
  • 3
    \$\begingroup\$ @LokiAstari: It might be, but it would be unrealistic. 270Ω, 5% is a standard part. \$\endgroup\$
    – Edward
    Commented Dec 4, 2014 at 19:18
11
\$\begingroup\$

Implement a simple calculator

Where the definition of "simple" is whatever you make it - only supports basic arithmetic operators? Fine. It supports scientific notation, exponents and trigonometry? Fine! Takes input from the console? Fine! Toggle between binary, hex, octal and decimal notations? Fine!

The common denominator here, is that you need:

  • A way to take user input
  • A way to parse/validate user input
  • A way to perform the operations in the input
  • A way to output the result(s)

Everything else you want to put in, is up to you and the time you can devote to this small project in the limited number of days we have until the hats come out of their boxes - be creative!

\$\endgroup\$
3
  • 1
    \$\begingroup\$ Hmm... What if your language basically is a simple calculator? cough ruby cough \$\endgroup\$
    – RubberDuck
    Commented Dec 2, 2014 at 23:00
  • 2
    \$\begingroup\$ Then you vote for Simon Says! ;) \$\endgroup\$ Commented Dec 2, 2014 at 23:01
  • 2
    \$\begingroup\$ @RubberDuck: There are a lot of languages that the equivalent of an eval() function that will execute arbitrary code in that language. So I think we can say that would be explicitly excluded. \$\endgroup\$ Commented Dec 4, 2014 at 19:19

You must log in to answer this question.

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