Skip to content

Instantly share code, notes, and snippets.

View indig0fox's full-sized avatar

Indigo indig0fox

View GitHub Profile
@indig0fox
indig0fox / DiceRoll.py
Created March 4, 2018 16:34
DiceRoll.py
"""This program will allow a user to attempt to guess a randomly generated number."""
from random import randint
from time import sleep
def get_user_guess():
user_guess = int(raw_input("What's your whole-number guess? "))
return user_guess
"""
This is a game of Rock, Paper, Scissors against the computer!
"""
from random import randint
from time import sleep
options = ["R", "P", "S"]
LOSE_MESSAGE = "Sorry, better luck next time!\n"
"""
--- Battleship ---
Make multiple battleships: you'll need to be careful because you need to make sure that you don’t place battleships on top of each other on the game board. You'll also want to make sure that you balance the size of the board with the number of ships so the game is still challenging and fun to play.
Make battleships of different sizes: this is trickier than it sounds. All the parts of the battleship need to be vertically or horizontally touching and you’ll need to make sure you don’t accidentally place part of a ship off the side of the board.
Make your game a two-player game.
@indig0fox
indig0fox / makePsArray
Created June 1, 2018 18:39
Outputs a plain-text formatted explicity declared Powershell array from a new-line separated list of items that is pasted or manually typed by the user. Written in Python 3.6.2
# Outputs a plain-text formatted explicity declared Powershell array from a new-line separated list of items that is pasted or manually typed by the user.
# Written in Python 3.6.2.
# [email protected]
items = []
userinput = input("Please enter the first list item: ")
items.append(userinput)
i = 2
@indig0fox
indig0fox / LCDConfigs.cs
Last active September 25, 2024 11:42
Space Engineers Automatic LCDs 2 Templates
// Reg Cockpit (Miner)
@0 AutoLCD
Center <Ores Aboard>
echo
InvListXS {T:*} +ore
@1 AutoLCD
Center <Energy Status>
PowerStored {T:Battery}
@indig0fox
indig0fox / controls.hpp
Last active May 6, 2021 07:38
Arma 3 Asset Table: Opens a UI table that shows details about all vehicles within 500m of the player.
//description.ext or controls.hpp
#include "\a3\ui_f\hpp\defineCommon.inc"
#define CT_CONTROLS_TABLE 19
class TestDisplay
{
idd = -1;
class controls
{
class _CT_CONTROLSTABLE
@indig0fox
indig0fox / drawSafeStartIcons.sqf
Created May 12, 2021 03:13
Label staff, 'officer' class men, and assets during safe start. Incl ACE Spectator compat check that won't overdraw the ACE Spectator names/group icons.
{
staffIconHelper = [{
{
// skip if not safe start
if (!phx_safetyEnabled) exitWith {};
// skip if ACE spectator is drawing group/name icons so as not to clash
if (missionNamespace getVariable "ace_spectator_drawunits") exitWith {};
_staff = missionNamespace getVariable["staffInfo", nil];
@indig0fox
indig0fox / about.txt
Created May 15, 2021 03:43
FetchStaffInfo
script that uses the url_fetch x64 extension to poll (every 180 seconds) a PHP site with a query param of playerUID to return an array containing player name and staff role, which is then folded into a broadcast variable and used on clients for rendering 3d icons, measuring restrictions, etc.
@indig0fox
indig0fox / fn_eh_fired.sqf
Created May 17, 2021 03:56
management of placed expl/mines and items thrown via ACE adv throwing or vanilla Throw action
// fired EH for non-bullets
// on any projectile that's not a bullet, draw a marker that tracks its position and persists 5 seconds after it 'dies'
// smoke grenades die when smoke stops coming out. frag grenades, explosives die after explosion.
{
_x addEventHandler["Fired", {
_this spawn {
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
@indig0fox
indig0fox / about.txt
Last active May 18, 2021 18:47
Tracking mine detonations
uses CBA function to add init code to the magazine that's placed, ACE_Explosives_Placed{classname} which gets the pos & execVMs a sideloaded script file
waits for magazine (placed, unarmed mine obj) to be objNull
checks for ammo obj in vicinity of magazine pos
if null, then mine was picked back up
if present, was armed and now an ammo obj exists as armed mine
gets info about armed mine, incl displayname of defaultMagazine property in config
waits for armed mine to be objNull