Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View jamesbraza's full-sized avatar
😋

James Braza jamesbraza

😋
View GitHub Profile
@jamesbraza
jamesbraza / war_infinite_loop.py
Created July 1, 2021 06:29
War simulator that limits the number of rounds
"""
War simulator that limits the number of rounds.
"Fork": https://lethain.com/war-card-game-in-python/
I expanded the code to plot the probability the game of War finishes within
a limit on the rounds. This was part of an extra credit problem in a CS class.
"""
import random
@jamesbraza
jamesbraza / black_selection.sh
Last active March 9, 2020 15:27 — forked from BasPH/black_selection.sh
Black on selection
#!/usr/bin/env bash
# Source: https://blog.godatadriven.com/black-formatting-selection
# Added debugging prints, permissioning/cleanup, and also a bugfix for
# selecting whole file.
# Print commands/arguments for debugging
set -x
# Inputs