Добавил параметр для указания числа шагов

This commit is contained in:
2024-11-09 18:52:39 +03:00
parent 2e7c02ca85
commit af18cc7b28
2 changed files with 7 additions and 3 deletions

View File

@@ -16,8 +16,9 @@
"outputs": [], "outputs": [],
"source": [ "source": [
"with open('test.txt', 'r', encoding='utf-16') as file:\n", "with open('test.txt', 'r', encoding='utf-16') as file:\n",
" data_str = file.read()\n", " lines = file.readlines()\n",
"\n", "\n",
"data_str = ''.join(lines[1:])\n",
"x, y = list(zip(*eval(data_str)))" "x, y = list(zip(*eval(data_str)))"
] ]
}, },

View File

@@ -35,5 +35,8 @@ barnsleyFern start n = do
main :: IO () main :: IO ()
main = do main = do
fractal <- barnsleyFern (0, 0) 1000 putStrLn "Укажите количество шагов рекурсии:"
print fractal input <- getLine
let n = read input :: Int
fractal <- barnsleyFern (0, 0) n
print fractal