From a0c6bc139ec7db0e5fb569f1c526afe660dcdec3 Mon Sep 17 00:00:00 2001 From: Mike Bloy Date: Thu, 3 Aug 2023 17:09:49 -0500 Subject: [PATCH] ex1.1 --- .gitignore | 1 + art.py | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 art.py diff --git a/.gitignore b/.gitignore index 68bc17f..8a92c10 100644 --- a/.gitignore +++ b/.gitignore @@ -158,3 +158,4 @@ cython_debug/ # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. #.idea/ +Session.vim diff --git a/art.py b/art.py new file mode 100644 index 0000000..fbc778a --- /dev/null +++ b/art.py @@ -0,0 +1,16 @@ + +# art.py + +import sys +import random + +chars = '\|/' + +def draw(rows, columns): + for r in range(rows): + print(''.join(random.choice(chars) for _ in range(columns))) + +if __name__ == '__main__': + if len(sys.argv) != 3: + raise SystemExit("Usage: art.py rows columns") + draw(int(sys.argv[1]), int(sys.argv[2]))