From 7782959e45261f842a8341a07277e136a9c7652a Mon Sep 17 00:00:00 2001 From: Nathan Hardy Date: Wed, 20 Sep 2017 17:15:01 +1200 Subject: [PATCH] Create scaffold --- .editorconfig | 11 +++++++++++ .gitignore | 4 ++++ LICENSE | 21 +++++++++++++++++++++ README.md | 11 +++++++++++ main.py | 24 ++++++++++++++++++++++++ test.txt | 2 ++ 6 files changed, 73 insertions(+) create mode 100644 .editorconfig create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md create mode 100644 main.py create mode 100644 test.txt diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..fa09052 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,11 @@ +# http://editorconfig.org + +root = true + +[*] +indent_style = space +indent_size = 4 +insert_final_newline = true +trim_trailing_whitespace = true +end_of_line = lf +charset = utf-8 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ac98ea4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +__pycache__/ +*.py[cod] +.DS_Store +.vscode diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..2c4755a --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Daniel Thomson, Levi Faid, Nathan Hardy, Rebecca Wilson + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..d515672 --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +# Étude 9 + +Python 3 solution for COSC326 Étude 9 - Sir Tet's Carpets + +See http://www.cs.otago.ac.nz/cosc326/PDF/9-Sir%20Tet.pdf for more details + +## Usage + +``` +cat test.txt | ./main.py +``` diff --git a/main.py b/main.py new file mode 100644 index 0000000..710139a --- /dev/null +++ b/main.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python3 + +""" +Etude 9 - Sir Tet's Carpets +Authors: Daniel Thomson, Levi Faid, Nathan Hardy, Rebecca Wilson +""" + +import sys + +def main(): + for unstripped_line in sys.stdin.readlines(): + line = unstripped_line.strip() + + if line.startswith('#') or line == '': + continue + + print(line) + + result = 0 # TODO: Actually do something + + print('# {}'.format(result)) + +if __name__ == '__main__': + main() diff --git a/test.txt b/test.txt new file mode 100644 index 0000000..1ded66e --- /dev/null +++ b/test.txt @@ -0,0 +1,2 @@ +6 10 +# over 9000