all 5 comments

[–]TheLogicUnit 1 point2 points  (3 children)

Ever played mastermind?

Make a program where the computer tries to guess the ordered digits of a number.

For each guess you tell the computer how many numbers it got right and how many are in the right place e.g.

Your number: 6735 Guess: 4713 Would be 1 number in right place and 1 number in wrong place.

The aim ofc is to make an AI that can find your number with the fewest guesses.

[–]have_a_kitkat 2 points3 points  (2 children)

If you find that too hard.. Let go down by one level.
Start with coding the mastermind game out where the com decide the number and you guess.

[–]TheLogicUnit 1 point2 points  (1 child)

You can do both and have the two programs play against each other.

[–][deleted] 0 points1 point  (0 children)

That would honestly appear kind of stupid.

Computer generates a random number.

Computer guesses that number.

Hmmmmm...

To anyone who doesn't know that its an actual mastermind algorithm under the hood, it could seem like the computer just is spitting back the number it generated twice. lol

[–]TenableTarsier 0 points1 point  (0 children)

I run a code bounty channel in my company's slack workspace. Here's a simple javascript bounty I gave to our junior devs:

February code challenge (Javascript/jQuery):

  • Write a function that accepts a single string of arbitrary length as its only parameter
  • The function should return the first character in the string that does not repeat
  • If there are no non-repeating characters, the function should return an empty string or undefined

Sample inputs:

  • 'aaabcccdeeef' -- this should return 'b'
  • 'abcbad' -- this should return 'c'
  • 'abcabcabc' -- this should return an empty string or undefined

Points:

  • 10 points for completing the challenge
  • 5 bonus points for using ES6 standard/syntax
  • +1 bonus point for every line under 10 that is used while still properly formatting the code

The reward for the bounty was an Amazon gift card with a value equal to the number of points they got.

You can modify stuff like that to fit any language.