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
// Rol: a language transpiled to Lua for all you Lua syntax haters | |
// Overall the language is quite C-like | |
print("Hello, World!") | |
// Semicolons are not required, but can be used | |
print("Semi");print("colon") | |
// Idk about variable syntax, is similar to Kotlin | |
var a: Int = 1 |
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
char (arity) - desc | |
whitespace - nop | |
newline - Starts a new function | |
! (1) - (any) logical not | |
" - String literal | |
# - Misc digraph char | |
$ (1) - (any) reverse | |
% (2) - (num, num) b mod a, (str, any) replace % in a with b | |
& (2) - (num, num) bitwise AND |
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
import org.bukkit.util.noise.SimplexOctaveGenerator; | |
import org.junit.jupiter.api.Assertions; | |
import java.util.concurrent.CountDownLatch; | |
import java.util.concurrent.ThreadLocalRandom; | |
public class OctaveGeneratorThreadTest { | |
public static void main(String[] args) throws InterruptedException { | |
int threadCount = 500; // set this to the number of threads to use in testing |
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
""" | |
A minimalistic Turing machine I wrote for an assignment. | |
Has 4 commands: > (unconditional branch), + (add), x (halt), and ? (branch if zero). > adds to the current | |
tape location by x, where x is the number right after the command. + adds the number in absolute | |
position a to the number in absolute position b, one-indexed, where a and b are the two numbers | |
following the command. x stops the program and prints the contents of the tape. ? checks if the previous | |
number is zero, if it is, add x to the tape position, where x is the number following the command. | |
Sample multiplication program: > 7 c a b ? 4 > 3 x + 4 3 -1 + 14 5 > -13, where c is the result |
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
Map<Location, Map<String, String>> storage = new HashMap<>(); | |
try (MockedStatic<BlockStorage> bsMock = Mockito.mockStatic(BlockStorage.class)) { | |
bsMock.when(() -> BlockStorage.addBlockInfo(any(Block.class), anyString(), anyString())) | |
.then((Answer<Void>) a -> { | |
Block b = a.getArgument(0, Block.class); | |
storage.computeIfAbsent(b.getLocation(), k -> new HashMap<>()) | |
.put(a.getArgument(1), a.getArgument(2)); | |
return null; | |
} |