Skip to content

Instantly share code, notes, and snippets.

View rcurtis's full-sized avatar

Robert Curtis rcurtis

View GitHub Profile
@rcurtis
rcurtis / MapExt.fs
Last active December 11, 2020 14:20
let rec containsAllKeysRec (keys: string list)(map: Map<string, string>) : bool =
let rec found k (m: Map<_,_>) =
match k with
| [x] -> if m.ContainsKey x then true else false
| x::xs -> found xs m
| _ -> true
found keys map
let containsAllKeys (keys: string list)(map: Map<string, string>) : bool =
let mutable missing = false
module RobotSimulator
open System
type Direction = North | East | South | West
type Position = int * int
type Robot = { direction: Direction; position: Position }
type Command =
| TurnLeft
@rcurtis
rcurtis / Comm.gd
Last active September 25, 2023 20:37
extends Node
var client
var wrapped_client
var connected = false
var message_center
var should_connect = false
func _ready():
#include "tweeny.h"
#include <cstdio>
bool print(tweeny::tween<int> &, int x) {
printf("%d\n", x); return false;
}
void main()
{
printf("infinite loop example\n");
VertexArray _verts = new VertexArray(PrimitiveType.Quads, 4);
_verts.Append(new Vertex(new Vector2f(100, 200), Color.Red));
_verts.Append(new Vertex(new Vector2f(100, 0), Color.Red));
_verts.Append(new Vertex(new Vector2f(200, 100), Color.Red));
_verts.Append(new Vertex(new Vector2f(200, 200), Color.Red));
_window.Draw(_verts);
public static string Reverse(string input)
{
var builder = new StringBuilder(input.Length);
for (var i = input.Length - 1; i >= 0; i--)
{
builder.Append(input[i]);
}
return builder.ToString();
}
public static string Reverse(string input)
{
var builder = new StringBuilder(input.Length);
for (var i = input.Length - 1; i >= 0; i--)
{
builder.Append(input[i]);
}
return builder.ToString();
}
using System;
using MotionNET;
using SFML.Graphics;
using SFML.Window;
namespace MotionTest
{
class Program
{
private RenderWindow window;
1>------ Build started: Project: ZERO_CHECK, Configuration: Release Win32 ------
1> Checking Build System
1> CMake does not need to re-run because C:/Users/Robert/Desktop/freetype-gl/Build/CMakeFiles/generate.stamp is up-to-date.
2>------ Build started: Project: freetype-gl, Configuration: Release Win32 ------
2> Building Custom Rule C:/Users/Robert/Desktop/freetype-gl/CMakeLists.txt
2> CMake does not need to re-run because C:\Users\Robert\Desktop\freetype-gl\Build\CMakeFiles\generate.stamp is up-to-date.
2> mat4.c
2>..\mat4.c(125): warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
2>..\mat4.c(127): warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
2>..\mat4.c(129): warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
public class StaticWTF
{
{
System.out.println("Before constructor");
}
static
{
System.out.println("Static before constructor");
}