View bf2c.sh
echo '#include <stdio.h>' | |
echo 'int main(void) {' | |
echo 'int tape[256] = {0};' | |
echo 'int i = 0;' | |
cat $@ |\ | |
sed -e 's/\]/}/g' |\ | |
sed -e 's/\[/while(tape\[i\]){/g' |\ | |
sed -e 's/+/tape\[i\]++;/g' |\ | |
sed -e 's/-/tape\[i\]--;/g' |\ | |
sed -e 's/>/i++;/g' |\ |
View Main.scala
// libraryDependencies += "org.scala-lang.modules" %% "scala-parser-combinators" % "1.1.2" | |
import scala.util.parsing.combinator._ | |
import scala.collection.mutable._ | |
sealed trait SExpr | |
case class Symbol(x: String) extends SExpr | |
case class IntLiteral(x: Int) extends SExpr | |
case class SList(xs: List[SExpr]) extends SExpr | |
sealed trait SValue |
View GIf.hs
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE PolyKinds #-} | |
{-# LANGUAGE RebindableSyntax #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
module GIf where | |
import Data.Kind | |
import GHC.Generics | |
import Prelude |
View Main.hs
module Main where | |
newtype IODouble = IODouble { runIODouble :: IO Double } | |
instance Num IODouble where | |
fromInteger x = IODouble $ do | |
print x | |
pure $ fromInteger x | |
(IODouble x) + (IODouble y) = IODouble $ do | |
x' <- x |
View foo.s
.intel_syntax noprefix | |
.text | |
not: | |
ret | |
f: | |
call not | |
ret | |
# 以下ログ | |
# Stack dump: |
View main.c
#include <stdlib.h> | |
#include <stdbool.h> | |
#include <stdio.h> | |
#include <gc.h> | |
#include <stdint.h> | |
struct value; | |
struct env | |
{ |
View main.c
#include <stdio.h> | |
#include <stdint.h> | |
#include <stdlib.h> | |
#include <gc.h> | |
union value; | |
struct env; | |
struct closure; | |
union value; |
View main.js
const Discord = require('discord.js'); | |
function getRandomInt(min, max) { | |
min = Math.ceil(min); | |
max = Math.floor(max); | |
return Math.floor(Math.random() * (max - min)) + min; //The maximum is exclusive and the minimum is inclusive | |
} | |
function diceRoll(count, roll) { | |
let dices = []; |
View main.cc
#include <iostream> | |
#include <tuple> | |
#include <algorithm> | |
#include <vector> | |
using namespace std; | |
template <typename T> | |
unsigned int digit_sum(T x, unsigned int base) { | |
auto result = 0; |
NewerOlder