This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |