Добавил параметр для указания числа шагов
This commit is contained in:
@@ -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)))"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -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
|
||||||
Reference in New Issue
Block a user