Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[*.yml]
indent_size = 2

[*.yaml]
indent_size = 2

[Makefile]
indent_style = tab
5 changes: 5 additions & 0 deletions .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt

- name: Syntax check with py_compile
run: |
find . -name "*.py" -exec python -m py_compile {} +
Expand Down
5 changes: 4 additions & 1 deletion games/Dots-Boxes-AI/Dots-Boxes-AI.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,12 @@ def ai_move():
print(YELLOW + "⚠️ Line already taken!" + RESET)
continue
vertical_lines[row][col] = True
except:
except IndexError:
print(RED + "❌ Position out of range!" + RESET)
continue
except ValueError:
print(RED + "❌ Invalid input!" + RESET)
continue

symbol = 'P' if current_player == 1 else 'A'
got_box = check_boxes(symbol)
Expand Down
2 changes: 1 addition & 1 deletion games/Flappy-Game/Flappy-Game.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def reset_game():
try:
with open(highscore_path, "r") as file:
high_score = int(file.read())
except:
except (FileNotFoundError, ValueError, OSError):
high_score = 0

def inside(point):
Expand Down
4 changes: 2 additions & 2 deletions games/Math-Quiz/Math-Quiz.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ def play_sound(sound_type):
winsound.Beep(300, 300)
elif sound_type == 'game_over':
winsound.Beep(200, 600)
except:
except (RuntimeError, OSError):
pass

def load_scores():
if os.path.exists("math_quiz_scores.json"):
try:
with open("math_quiz_scores.json", "r") as f:
return json.load(f)
except:
except (FileNotFoundError, json.JSONDecodeError, OSError, UnicodeDecodeError):
pass
return {"highest_score": 0, "longest_streak": 0}

Expand Down
Loading