Skip to content

Instantly share code, notes, and snippets.

View PsichiX's full-sized avatar
👨‍🔬
For the Symmetry! [mental health vacation]

Patryk Budzyński PsichiX

👨‍🔬
For the Symmetry! [mental health vacation]
View GitHub Profile
@PsichiX
PsichiX / arithmetics.i4s
Last active August 9, 2016 07:08
Intuicio4 Assembly Script - design v1.0
#!/usr/bin/env i4s
#intuicio 4.0;
#stack 8k;
#memory 16k;
#entry @Main;
#pointersize 32;
#import from [IO:print] routine print(format:*i8, ...):;
@PsichiX
PsichiX / WinnerRandomSelector.cs
Created April 20, 2016 03:55
WinnerRandomSelector
using System;
using System.Collections.Generic;
using System.IO;
namespace WinnerRandomSelector
{
class Program
{
static void Main(string[] args)
{
@PsichiX
PsichiX / test.jg
Last active June 26, 2016 18:02
Design of Jaeger - functional language based on Intuicio4 platform
#!/usr/bin/env jaeger
# directive that tells compiler
# what function from which native module we will use.
/use roar from "jaeger_std"/
/use waitForMilliseconds from "jaeger_std"/
#/jaegerify "file_open(path:*i8, mode:*i8):*i32" from "IO"/
# directive that tells compiler which function is program entry point.
/start main/
@PsichiX
PsichiX / grammar.hpp
Last active July 7, 2016 20:05
Jaeger grammar file
#ifndef __GRAMMAR_H__
#define __GRAMMAR_H__
#include "std_extension.h"
#include <pegtl.hh>
namespace Grammar
{
struct function_call;
struct data;
@PsichiX
PsichiX / entry.i4s
Created August 16, 2016 01:38
Intuicio4 Protocols Test
#!/usr/bin/env i4s
#intuicio 4.0;
#stack 8k;
#memory 16k;
#entry @Main;
#pointersize 32;
#import from [IO:print] routine print(format:*i8, ...):;
#import from [IO:get_line_new] routine get_line_new():*i8;
@PsichiX
PsichiX / library.cpp
Created June 2, 2017 16:33
Shared Library Manager
#include "library.h"
#ifdef BUILD_LINUX
#include <dlfcn.h>
#endif
#ifdef BUILD_WIN
#include <windows.h>
#endif
#include <map>
struct Handle
@PsichiX
PsichiX / CarController.cs
Last active June 28, 2017 16:26
car program
using I4.NET;
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text;
using UnityEngine;
using UnityEngine.UI;
namespace I4.Unity.Example
{
@PsichiX
PsichiX / side.gml
Last active October 16, 2017 20:14
[GML] Calculate if enemy is on the right or right side of our instance
// calcualte position difference (a.k.a. tangent vector):
var dx = enemy.x - x;
var dy = enemy.y - y;
// calculate angle in radians of instance:
var rad = degtorad(image_angle);
// calculate where is instance right side (a.k.a. binormal vector):
var bx = -sin(rad);
var by = cos(rad);
@PsichiX
PsichiX / test-cpp.chrobry
Created April 3, 2020 18:02
Data Driven Template engine
// import './serialization.chrobry'
inject
```
#pragma once
#include <string>
#include <sstream>
```
extern 'int' 'float' {
@PsichiX
PsichiX / 0_raui_hello.rs
Last active December 5, 2020 03:31
RAUI data oriented API (declarative UI)
#[test]
fn test_hello_world() {
// convenient macro that produces widget component processing function.
widget_component! {
// <component name> ( [list of context data to unpack into scope] )
app(key, named_slots) {
// easy way to get widgets from named slots.
unpack_named_slots!(named_slots => { title, content });
// we always return new widgets tree.