Skip to content

Instantly share code, notes, and snippets.

@ap0ught
ap0ught / CircularMenu.cs
Created June 6, 2019 20:15 — forked from KenneyNL/CircularMenu.cs
Circular menu sample code for Unity
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CircularMenu : MonoBehaviour{
public float radius = 100.0f;
public float offset = 0.0f;
void Start(){
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
void Start()
{
int spawned = 0;
while (spawned < numToSpawn)
{
position = new Vector3(Random.Range(100.0F, 1000.0F), 70, Random.Range(100.0F, 1000.0F));
Instantiate(ammoDrop, position, Quaternion.identity);
spawned++;
}
@ap0ught
ap0ught / tictactoe.cpp
Created July 10, 2017 21:00 — forked from a12x/tictactoe.cpp
tic tac toe
#include <iostream>
#include <iomanip>
#define BINARY(x) 0b##x
const short UPPER_LEFT = BINARY(100000000);
const short FULL_BOARD = BINARY(111111111);
const short HORIZ_0 = BINARY(111000000);
@ap0ught
ap0ught / ants.pde
Created July 10, 2017 18:35 — forked from arctangent/ants.pde
Ant Colony Simulation in Processing
// Ant Foraging Simulator
// Jacob Conrad Martin
// http://jacobconradmartin.com
import processing.video.*;
MovieMaker mm;
// *** CONFIG ***
int worldWidth = 400;
@ap0ught
ap0ught / PiDay.cs
Created March 16, 2017 17:47 — forked from ThirdPartyNinjas/PiDay.cs
Calculating Pi from random numbers
using System;
namespace PiDay
{
// The probability of two random numbers to be coprime is P = 6 / Pi^2
// So let's generate a bunch of random numbers. Figure out how often they're coprime.
// Use that percentage as our probabilty and solve for Pi.
// Pi = sqrt(6 / P)
// For more info, watch the video where I stole the idea: https://youtu.be/RZBhSi_PwHU
#!/usr/bin/env perl
use strict;
use warnings;
use Getopt::Long;
Getopt::Long::Configure("pass_through");
use Pod::Usage;
our $APP = 'perl_test';
@ap0ught
ap0ught / thornbrush-farm
Created July 16, 2015 21:57
thornbrush-farm
# Patrol the village entrances.
# Build a "fire-trap" when you see an ogre.
# Don't blow up any peasants!
loop:
self.moveXY(43, 50)
if self.findNearestEnemy():
self.buildXY("fire-trap", 43, 50)
self.moveXY(25, 34)
if self.findNearestEnemy():