diff options
| author | omagdy7 <omar.professional8777@gmail.com> | 2022-09-14 22:11:44 +0200 |
|---|---|---|
| committer | omagdy7 <omar.professional8777@gmail.com> | 2022-09-14 22:11:44 +0200 |
| commit | 72c46d547eeee2fe7700ec2dbbb97b9c0f67a373 (patch) | |
| tree | a5316503df2d9f15d8c4af532230427e711f79d1 /presets/newfiles.py | |
| parent | 4023db5205bacef6cf6cb9d41ab4cdfa90cd5b32 (diff) | |
| download | gof-rs-72c46d547eeee2fe7700ec2dbbb97b9c0f67a373.tar.xz gof-rs-72c46d547eeee2fe7700ec2dbbb97b9c0f67a373.zip | |
Added a few scripts to parse the large pattern file of game of life patterns and also added the functionality to scroll through the list and it affects the current world
Diffstat (limited to 'presets/newfiles.py')
| -rw-r--r-- | presets/newfiles.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/presets/newfiles.py b/presets/newfiles.py new file mode 100644 index 0000000..954dd74 --- /dev/null +++ b/presets/newfiles.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 + +with open("/home/pengu/test/rust-dev/gof-rs/presets/patterns-striped.txt", "r") as file: + cnt = 0 + content = "" + for line in file.readlines(): + print(line) + print("ehll") + if line != '\n': + content += line.rstrip().center(72, ".") + '\n' + print("Hello" + content) + if line == '\n': + with open(f"./pattern{cnt}.txt", "w") as pat: + print(content) + pat.write(content) + content = "" + cnt += 1 + |
