Skip to content

Instantly share code, notes, and snippets.

View mrbid's full-sized avatar

James William Fletcher mrbid

View GitHub Profile
@mrbid
mrbid / neural_zodiac.c
Last active January 16, 2023 16:00
Neural Zodiac Love Compatibility Calculator for Polyamory (for science)
// v2 an improvement over the original.
// github.com/mrbid
// https://github.com/jcwml/neural_zodiac
// gcc main.c -lm -Ofast -mfma -o main
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
@mrbid
mrbid / esAux3.h
Last active January 10, 2024 14:58
A simple helper library for OpenGL ES / WebGL applications.
/*
--------------------------------------------------
James William Fletcher (github.com/mrbid)
December 2022 - esAux3.h v3.0
--------------------------------------------------
A pretty good color converter: https://www.easyrgb.com/en/convert.php
Lambertian fragment shaders make a difference, but only if you normalise the
vertNorm in the fragment shader. Most of the time you won't notice the difference.
@mrbid
mrbid / vec_ts.h
Created December 6, 2022 19:32
Portable floating-point Vec3 library with SSE support (THREAD-SAFE)
/*
James William Fletcher (github.com/mrbid)
September 2021
Portable floating-point Vec3 lib with basic SSE support
This is the THREAD-SAFE version.
*/
#ifndef VEC_H
@mrbid
mrbid / esAux2.h
Last active January 10, 2024 14:58
A simple helper library for OpenGL ES / WebGL applications.
/*
--------------------------------------------------
James William Fletcher (github.com/mrbid)
December 2022 - esAux2.h v2.2
--------------------------------------------------
A pretty good color converter: https://www.easyrgb.com/en/convert.php
The shadeFullbrightT() shader is for menu's, generally the idea otherwise
is to use vertex color arrays, they are more efficient than using UV coordinates
@mrbid
mrbid / csgo_mrbid_net_bot.c
Last active January 7, 2023 12:16
The best trained minimal CNN bot for CS:GO.
/*
--------------------------------------------------
James William Fletcher (github.com/mrbid)
SEPTEMBER 2022
--------------------------------------------------
*** WIP, did I get the 4 dimensional array index right? where is walley leaking memory? ***
I lost interest in this for now, may revisit it next year.
This is a forward pass network I have spent a lot of
@mrbid
mrbid / csgo_mrbid_net.h
Last active September 8, 2022 04:14
The best trained minimal CNN weights for CS:GO.
#ifndef csgo_mrbid_net
#define csgo_mrbid_net
/*
James William Fletcher
github.com/mrbid - September 2022
This is a forward pass network I have spent a lot of
time working on from scratch. As of this month and
year I consider this to be the best performing
@mrbid
mrbid / csgo_fnn_autoshoot.c
Last active January 15, 2023 14:26
An autoshoot bot for CS:GO that uses a Feed-Forward Neural Network.
/*
--------------------------------------------------
James William Fletcher (github.com/mrbid)
JANURARY 2023
--------------------------------------------------
You may want to install espeak via your package manager.
sudo apt install clang espeak libx11-dev
@mrbid
mrbid / quakelive_bluebones_autoshoot.c
Last active January 7, 2023 12:16
Autoshoot bot for Quake 3 & Quake Live.
/*
--------------------------------------------------
James William Fletcher (github.com/mrbid)
February 2020 - October 2021
--------------------------------------------------
This is a re-release with a crosshair and other
minimal changes.
This uses pre-computed weights designed to target
only the aqua blue bones model.
@mrbid
mrbid / solution2.c
Last active April 23, 2022 13:07
Bitboolbench Solution 2
// Here is also a version with always_inline; https://godbolt.org/z/1hcvv65Pv
// performance is basically the same.
#include <stdio.h>
#define uint unsigned int
struct Bits
{
unsigned b0:1, b1:1, b2:1, b3:1, b4:1, b5:1, b6:1, b7:1;
};
union CBits
@mrbid
mrbid / solution1.c
Created April 10, 2022 11:45
Bitboolbench Solution 1
#include <stdio.h>
#define uint unsigned int
unsigned char toByte(uint b[8])
{
unsigned char c = 0;
for(int i=0; i < 8; ++i)
if(b[i])
c |= 1 << i;
return c;