Skip to content

Instantly share code, notes, and snippets.

View thygrrr's full-sized avatar
infinite loop

tiger tiger tiger thygrrr

infinite loop
View GitHub Profile
@thygrrr
thygrrr / ControlSystem.cs
Last active February 5, 2022 12:43
A ECS system where a physical object can "cut" through a turn and glide like a ship or a bird.
using Jovian.ECS.Components;
using Jovian.ECS.Components.Space;
using Jovian.ECS.Components.Vessels;
using Jovian.ECS.Systems.Physics;
using Unity.Burst;
using Unity.Entities;
using Unity.Jobs;
using Unity.Mathematics;
using Unity.Physics;
using Unity.Physics.Systems;
from typing import Collection
def count_bits(diagnostics: Collection[str]) -> (list[int], int):
bit_counts = []
for number in diagnostics:
for bit_index, binary_digit in enumerate(number):
while bit_index >= len(bit_counts):
bit_counts.append(0)
@thygrrr
thygrrr / ListExtensions.cs
Last active April 28, 2021 23:39
Array and List Extensions for Unity
using System;
using System.Collections.Generic;
using Random = UnityEngine.Random;
namespace Tiger.Util
{
public static class ListExtensions
{
/// <summary>Returns a random element from the list</summary>