Powered by AppSignal & Oban Pro
Would you like to see your link here? Contact us

Number Wordle

number_wordle.livemd

Number Wordle

Mix.install([
  {:kino, github: "livebook-dev/kino", override: true},
  {:kino_lab, "~> 0.1.0-dev", github: "jonatanklosko/kino_lab"},
  {:vega_lite, "~> 0.1.4"},
  {:kino_vega_lite, "~> 0.1.1"},
  {:benchee, "~> 0.1"},
  {:ecto, "~> 3.7"},
  {:math, "~> 0.7.0"},
  {:faker, "~> 0.17.0"},
  {:utils, path: "#{__DIR__}/../utils"},
  {:tested_cell, git: "https://github.com/BrooklinJazz/tested_cell"}
])

Navigation

Return Home Report An Issue

Number Wordle

Wordle is a popular game where players get six attempts to guess a word. They are given feedback clues to guess the word.

  • Green if the letter is in the word and in the correct spot.
  • Yellow if the letter is in the word but in the incorrect spot.
  • Gray if the letter is not in the word.

For example for the word “TOAST” the guess “TARTS” would be

flowchart LR
style 1 fill:green
style 2 fill:gray
style 3 fill:gray
style 4 fill:yellow
style 5 fill:yellow

1[T] --- 2[A] --- 3[R] --- 4[T] --- 5[S]

You’re going to create a wordle game but for numbers.

It should provide feedback for a guess and and answer.

NumberWordle.feedback(3689, 3598)
[:green, :gray, :yellow, :yellow]

Ensure you handle numbers with multiple of the same digit. For example,

NumberWordle.feedback(1113, 2221)
[:yellow, :gray, :gray, :gray]

NumberWordle.feedback(1113, 2211)
[:yellow, :gray, :green, :gray]

NumberWordle.feedback(1111, 2111)
[:gray, :green, :green, :green]

Enter your solution below.

defmodule NumberWordle do
  def feedback(guess, answer) do
  end
end

Utils.feedback(:number_wordle, NumberWordle)

Commit Your Progress

Run the following in your command line from the project folder to track and save your progress in a Git commit.

$ git add .
$ git commit -m "finish number wordle exercise"