Skip to content

Instantly share code, notes, and snippets.

View boraini's full-sized avatar
💭
YEET

Mert Bora İnevi boraini

💭
YEET
View GitHub Profile
@boraini
boraini / yeet.rs
Last active January 22, 2024 03:46
Yeets with error if the linked list was empty during remove-first call.
#![feature(yeet_expr)]
/// Represents a linked list item
struct LinkedListItem<T: Clone> {
/// The item stored in the slot
item : T,
/// Link to the next item in the list
next_item : Option<Box<LinkedListItem<T>>>,
}
@boraini
boraini / bf.c
Created November 4, 2023 16:32
Well-written Brainf*ck interpreter in C by Boraini
/*
* Well-written Brainfuck interpreter in C by Boraini.
* github.com/boraini
*
* Aim
* ==================
* I plan to also write this in either x86 or RISC-V assembler language, and this is to explore algorithms to do so.
* Because of this, I didn't employ any structs, complex pointer logic etc.
*
* Features
@boraini
boraini / character_walking_motion_planning.html
Created April 26, 2023 19:23
Character Walking Motion Planning
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Walking Motion Planning</title>
<style>
#canvas {
border: 1px solid black;
class HammingCode {
/**
* Replace the bit with the bit represented with a Boolean value. Index 1 is the least significant bit.
*
* @param current The input bit sequence
* @param n The bit index to replace (Index 1 is the least significant bit)
* @param bit Boolean indicating the replacement bit
* @return Input current but with the bit replaced
*/
@boraini
boraini / bf.go
Created September 2, 2021 23:25
1024-cell Brainf*ck interpreter written in Go.
package main
import (
"fmt"
"os"
"bufio"
"io"
)
var tape [1024]byte = [1024]byte{}

Three.js is a cool library. It provides some 3D object rendering, animating, and hierarchy creation functionality that brings it to the level of industry-standard 3D game making studio programs (I think I don't need to give names here.) Although the library is good and functions well, structuring the project as code is pretty much given into the hands of the end developer. How assets are loaded (which I can't help criticizing - you need to copy module files from three.js examples AFAIK), how the scene is generated how all the animation mixers run in unison are given as problems to the developer.

I've seen pretty ingenius solutions to these problems, including using React to structure the app/game into components. Standardizing how the project is structured and works is important so in this document I'll list what solutions are needed so I can work on them before attempting the next big three.js projects.

#by Mert Bora İnevi, https://github.com/boraini
#written for his Discrete Mathematics Yearly Homework Project in 2021
#python 3.7.1
import math
import networkx as nx
import matplotlib.pyplot as plt
import random
import numpy as np
from scipy.spatial import Voronoi, voronoi_plot_2d
@boraini
boraini / Boraini's Custom.kateschema
Last active June 15, 2020 21:46
Kate IDE Custom Color Schema: Similar to Material syntax theme found in other IDEs. White and desaturated neon text on dark purple background. Lila is used for text in blur.
[Default Item Styles - Schema Boraini's Custom]
Alert=ffda4453,ffda4453,1,,,,-,-,,---
Annotation=ff752beb,ff5620ae,,,,,-,-,,---
Attribute=ff2679ff,ff2679ff,,,,,-,-,,---
Base-N Integer=fff67400,fff67400,,,,,-,-,,---
Built-in=ff2679ff,ff2679ff,1,,,,-,-,,---
Character=ff84ff08,ff83ff08,,,,,-,-,,---
Comment=ff752beb,ff5620ae,,,,,-,-,,---
Comment Variable=ff752beb,ff5620ae,,,,,-,-,,---
Constant=ff1951aa,ff1951aa,1,,,,-,-,,---