This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #= | |
| Script that simulates multiple games of Among Us | |
| to count the number of players who were never the impostor in any of those games, | |
| then repeats this multiple times to find the average chance | |
| of there being a player who was never the impostor | |
| =# | |
| print("How many simulations? ") | |
| nsimulations = parse(Int, readline()) | |
| ## array of number of players that were never impostor for each simulation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| board = np.empty(shape=(9, 9), dtype=set) | |
| def isknown(cell): | |
| return len(cell) == 1 | |
| def construct_board(): | |
| with open("board.txt", "r") as f: | |
| for li, line in enumerate(f): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Data.Char (digitToInt, isNumber, toUpper) | |
| import Text.Printf (printf) | |
| import TimeLibrary (Time (..), addTimes, minTime) | |
| tracks :: [String] | |
| tracks = | |
| [ "Coventry Cove", | |
| "Mount Mayhem", | |
| "Inferno Isle", | |
| "Sunset Sands", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'dart:io'; | |
| String padInt2(int a) { | |
| return a.toString().padLeft(2, '0'); | |
| } | |
| void main() async { | |
| const tracks = [ | |
| "Coventry Cove", | |
| "Mount Mayhem", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package BARTimeCalcKotlin | |
| import java.io.File | |
| val tracks = arrayOf("Coventry Cove", "Mount Mayhem", "Inferno Isle", "Sunset Sands", "Metro Madness", "Wicked Woods") | |
| val greeting = | |
| """ | |
| BAR! Bonus Circuit IGT Calculator by AMathMonkey | |
| Input times in the format MSShh where M is minutes, SS is seconds and hh is hundredths | |
| Enter 'u' to undo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import std.stdio : File, write, writef, writeln, writefln, readln; | |
| import std.typecons : Nullable, nullable; | |
| import std.conv : to, ConvException; | |
| import std.format : format; | |
| import std.string : chomp, toLower; | |
| const string[] tracks = [ | |
| "Coventry Cove", "Mount Mayhem", "Inferno Isle", "Sunset Sands", | |
| "Metro Madness", "Wicked Woods", | |
| ]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| tracks = { | |
| "Coventry Cove", "Mount Mayhem", "Inferno Isle", "Sunset Sands", | |
| "Metro Madness", "Wicked Woods" | |
| } | |
| times = {} | |
| stdout = io.output() | |
| minutes, seconds, hundredths, i = 0, 0, 0, 1 | |
| print([[ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import haxe.io.Bytes; | |
| import Sys.*; | |
| import sys.io.File as File; | |
| class BARTimeCalculator { | |
| static final tracks = [ | |
| "Coventry Cove", | |
| "Mount Mayhem", | |
| "Inferno Isle", | |
| "Sunset Sands", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| tracks = ("Coventry Cove", "Mount Mayhem", "Inferno Isle", "Sunset Sands", "Metro Madness", "Wicked Woods") | |
| times = [] | |
| minutes = seconds = hundredths = i = 0 | |
| print( | |
| """BAR! Bonus Circuit IGT Calculator by AMathMonkey | |
| Input times in the format MSShh where M is minutes, SS is seconds and hh is hundredths | |
| Enter 'u' to undo""") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import socket | |
| import matplotlib.pyplot as plt | |
| from numpy import arange | |
| MPH_CHOICE = False # Change to True for mph not km/h | |
| freq = 0.05 # sampling rate of the speed value | |
| cycles = 300 # number of points to plot before stopping | |
| plt.xlim(0, freq * cycles) # make room in the x dimension for all the points |
NewerOlder