Commit Graph

16 Commits

Author SHA1 Message Date
steveglumify
0d5de95cfa Update superstartrek.py
Fixes issue #795- Ship class does not work correctly
2023-08-14 11:30:28 +12:00
Jack Boyce
192a6e7e62 remove author name from header 2023-04-02 00:02:24 -07:00
Marc Wilson
007b38751d add try/except to computer prompt, invalid input should not crash game 2022-09-03 09:38:19 -07:00
Martin Thoma
3a63978d0e Super Star Trek (Python): Introduce OOP
* Avoid encoding values in int; use tuples instead (the memory overhead
  is OK today)
* Avoid encoding values in str, use lists instead (same story)
* Use variable names that speak for themselves
* Fix typo (NAVAGATION)
2022-04-01 17:04:14 +02:00
Martin Thoma
9972ee4073 Super Star Trek (Python): Refactoring
* Add 'Ship' class to group code / avoid some global variables /
  avoid passing so many parameters around
* Use docstrings
2022-03-31 22:41:16 +02:00
Martin Thoma
d511a22b5e Annotate superstartrek 2022-03-31 10:41:30 +02:00
Martin Thoma
1b1d50986b Python: Add type annotations to all 'print' functions (#662)
* Add test to superstartrek and fixes several issues in superstartrek - I probably introduced them 🙈
* Mastermind type annotations
2022-03-21 10:41:14 +01:00
Martin Thoma
83b3dc402c Python: Add type annotations 2022-03-20 19:16:39 +01:00
Martin Thoma
3b2739b8a2 Clean Code: Apply flake8-simplify to Python
Also flake8-comprehensions which was added to the CI

For flake8-simplify, there are a few false-positives,
e.g. https://github.com/MartinThoma/flake8-simplify/issues/115
2022-03-18 22:29:56 +01:00
Martin Thoma
f52d9a0e54 Clean Code: Python
Fix issues found by flake8-bugbear:

* Unused loop variables
* assert statements in non-test code
* mixing test code with production code
* mark one excessive test which takes ~10min to run
  as 'slow'
2022-03-18 14:59:08 +01:00
Martin Thoma
5374569063 Python: Fix string concatenation 2022-03-15 13:57:28 +01:00
Martin Thoma
0ba0307767 Python: Fix linting issues
The following Flake8 issues were fixed:

* W291
* W504

* F821
* F401
* F541

* E402
* E711
2022-03-14 13:13:20 +01:00
Martin Thoma
2e957b1b27 Fix mypy issues in superstartrek 2022-03-13 08:46:55 +01:00
Martin Thoma
af88007734 Python: Fix Flake8 E722 and E741
Additionally:

* Use functions to group blocks of code
* Use variable names (not just one character...)
2022-03-12 08:17:03 +01:00
Martin Thoma
e64fb6795c MAINT: Apply pre-commit
Remove byte-order-marker pre-commit check as there would be
many adjustments necessary
2022-03-05 09:29:23 +01:00
Chris Reuter
d26dbf036a Removed spaces from top-level directory names.
Spaces tend to cause annoyances in a Unix-style shell environment.
This change fixes that.
2021-11-21 18:30:21 -05:00