This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package dev.kioba.minstack | |
sealed class MinStack<out A> { | |
companion object | |
} | |
object Nil : MinStack<Nothing>() | |
class Cons<A>(val head: A, val min: A, val tail: MinStack<A> = Nil) : MinStack<A>() | |
operator fun <A> MinStack.Companion.invoke(): MinStack<A> = Nil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. | |
# Initialization code that may require console input (password prompts, [y/n] | |
# confirmations, etc.) must go above this block; everything else may go below. | |
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then | |
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" | |
fi | |
export ZSH=$HOME/.oh-my-zsh | |
# ZSH_THEME="powerlevel10k/powerlevel10k" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package kioba.dev | |
sealed class Tree<T> | |
data class Leaf<T>(val value: T) : Tree<T>() | |
data class Node<T>(val left: Tree<T>, val right: Tree<T>) : Tree<T>() | |
fun <T> numberOfLeafs(tree: Tree<T>): Int = when (tree) { | |
is Leaf -> 1 | |
is Node -> numberOfLeafs(tree.left) + numberOfLeafs(tree.right) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package dev.kioba.ilist | |
sealed class IList<A> | |
class INil<A> : IList<A>() | |
class ICons<A>(val head: A, val tail: IList<A>) : IList<A>() | |
fun <A> iListOf(vararg arg: A): IList<A> = | |
arg.foldRight<A, IList<A>>(INil()) { element, acc -> ICons(element, acc) } | |
fun <A> IList<A>.forEach(f: (A) -> Unit): Unit = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun main(args: Array<String>) { | |
println("what is your name?") | |
val name = readLine() | |
println("Hello $name welcome to the ArrowGame!") | |
var exec = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int main() { | |
int x = 0; | |
while (x < 5) { | |
x = x++; | |
} | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# if(GLM_COMPONENT == GLM_COMPONENT_ONLY_XYZW) | |
value_type x, y, z, w; | |
# elif(GLM_COMPONENT == GLM_COMPONENT_MS_EXT) | |
union | |
{ | |
struct{value_type x, y, z, w;}; | |
struct{value_type r, g, b, a;}; | |
struct{value_type s, t, p, q;}; | |
}; | |
# else//(GLM_COMPONENT == GLM_COMPONENT_GLSL_NAMES) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Rect::create() | |
{ | |
static float a = 0; | |
a += 0.01f; | |
std::vector<float> vertex_buffer_data = { | |
0.0f + a, 0.0f + a, a, | |
0.3f + a, 0.0f + a, a, | |
0.3f + a, 0.3f + a, a, | |
0.0f + a, 0.0f + a, a, | |
0.3f + a, 0.3f + a, a, |
NewerOlder