Skip to content

Instantly share code, notes, and snippets.

View mikkelens's full-sized avatar
🦀

Mikkel mikkelens

🦀
View GitHub Profile
@mikkelens
mikkelens / main.rs
Created September 22, 2023 04:49
test
use std::cmp::{max, min};
use std::{
collections::{BTreeMap, BTreeSet},
io::Read,
};
fn main() {
// take input from kattis
let mut input = String::new();
let _result = std::io::stdin()
@mikkelens
mikkelens / Fighter1.cs
Created October 11, 2022 11:10
this made me win lol
protected override void FighterBehavior()
{
/* ATTEMPT 2:
* Avoid attack, then attack.
*/
if (EnemyIsAttacking())
{
MoveBackward();
}
using UnityEditor;
using UnityEngine;
namespace Tools.Editor.Drawers
{
[CustomPropertyDrawer(typeof(Optional<>))]
public class OptionalPropertyDrawer : PropertyDrawer
{
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
{
using System;
using UnityEngine;
namespace Tools
{
[Serializable]
public struct Optional<T>
{
[SerializeField] private bool enabled;
[SerializeField] private T value;
@mikkelens
mikkelens / AnimationCurveHelpers.cs
Last active July 11, 2022 21:44
my helpers for unity animation curves
using UnityEngine;
namespace ScriptTools
{
public static class AnimationCurveHelpers
{
/// <summary>
/// A helper for flipping an animation curve.
/// </summary>
/// <param name="curve"></param>