Skip to content

Instantly share code, notes, and snippets.

View ricmarinovic's full-sized avatar

Ricardo Marinovic ricmarinovic

View GitHub Profile
@ricmarinovic
ricmarinovic / guess.ex
Last active July 5, 2019 00:18
guess number
defmodule Playground do
def guess(actual, a..b) do
do_guess(actual, a..b, div(b, 2))
end
def do_guess(actual, a.._b, number) when actual < number do
print_number(number)
do_guess(actual, a..number, div(a + number, 2))
end
{
"editor.acceptSuggestionOnEnter": "off",
"editor.cursorBlinking": "blink",
"editor.cursorStyle": "block",
"editor.detectIndentation": false,
"editor.dragAndDrop": false,
"editor.fontFamily":
"'Fira Code', 'Source Code Pro', Menlo, Monaco, 'Courier New', monospace",
"editor.fontLigatures": true,
"editor.fontSize": 13,