This file contains hidden or 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
| /*** PRINTING STUFF ***/ | |
| #include <stdio.h> /* printf() */ | |
| #include <stdlib.h> /* system() */ | |
| #include <stdint.h> /* fixed width ints */ | |
| /*** UNIX STUFF ***/ | |
| #include <x86intrin.h> /* __rdtscp() */ | |
| #include <unistd.h> /* sleep() */ | |
| #define SHOW_CPUID 0 /* True/False */ |
This file contains hidden or 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
| #include <stdio.h> | |
| #include <stdlib.h> | |
| /* You can change between */ | |
| /* Letters and Numbers */ | |
| #define USE_LETTERS 1 | |
| #if (USE_LETTERS == 1) | |
| #define CELL_TYPE "char" | |
| #define PRINT_COMMAND "putchar(*p);" |
This file contains hidden or 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
| #include <stdio.h> | |
| #include <stdlib.h> | |
| int main(){char *m=(char*)calloc(0x8000,sizeof(char));char *p=m;++*p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;while(*p){--*p;++p;++*p;++*p;++p;++p;++p;++*p;++*p;++*p;++*p;++*p;++p;++*p;++*p;++p;++*p;--p;--p;--p;--p;--p;--p;}++p;++p;++p;++p;++p;++*p;++*p;++*p;++*p;++*p;++*p;++p;--*p;--*p;--*p;++p;++p;++p;++p;++p;++p;++p;++p;++p;++p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;++*p;while(*p){while(*p){++p;++p;++p;++p;++p;++p;++p;++p;++p;}++*p;while(*p){--p;--p;--p;--p;--p;--p;--p;--p;--p;}++p;++p;++p;++p;++p;++p;++p;++p;++p;--*p;}++*p;while(*p){++p;++p;++p;++p;++p;++p;++p;++p;while(*p){--*p;}++p;}--p;--p;--p;--p;--p;--p;--p;--p;--p;while(*p){--p;--p;--p;--p;--p;--p;--p;--p;--p;}++p;++p;++p;++p;++p;++p;++p;++p;while(*p){--*p;}++*p;--p;--p;--p;--p;--p;--p;--p;++*p;++*p;++*p;++*p;++*p;while(*p){--*p;while(*p){--*p;++p;++p;++p;++p;++p;++p;++p;++p;++p;++*p;--p;--p;--p;--p;--p;--p;--p;--p;--p;}++p;++p;++p;++p;++p;++p;++p;++p;++p;}++p;+ |
This file contains hidden or 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 java.lang.String; | |
| public class ColorTerm { | |
| private static final String ESC = "\033"; | |
| private int width = 16, height = 9; | |
| private boolean open = true; | |
| public static final int Black = 40; | |
| public static final int Red = 41; |
This file contains hidden or 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
| #ifndef XOR_RAND_HPP | |
| #define XOR_RAND_HPP | |
| #include <initializer_list> // std::initializer_list | |
| #include <cstdint> // Fixed Width Int | |
| #include <limits> // std::numeric_limits | |
| #include <bitset> // std::bitset | |
| namespace XORShift // Definitions | |
| { |
This file contains hidden or 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
| #ifndef FIXED_POINT_NUMBERS_HPP | |
| #define FIXED_POINT_NUMBERS_HPP 1 | |
| namespace Fixed | |
| { | |
| namespace FixedMath | |
| { | |
| template<class T> | |
| constexpr T GCD(T a, T b) { return (b == 0) ? a : GCD(b, a % b); } | |
| } |
This file contains hidden or 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
| #include <stdio.h> /* putchar, printf */ | |
| void printRot13(const char* str) | |
| { | |
| /* loop through string. Strings end with a \0 */ | |
| for(; *str != '\0'; ++str) | |
| { | |
| /* If letter is in the lower 13 letters, add 13 */ | |
| if (*str >= 'A' && *str <= 'M') { putchar(*str + 13); } | |
| else if (*str >= 'a' && *str <= 'm') { putchar(*str + 13); } |
This file contains hidden or 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
| /* | |
| Copyright 2018, Sam R. Belliveau | |
| Permission is hereby granted, free of charge, to any person obtaining a copy | |
| of this software and associated documentation files (the "Software"), to deal | |
| in the Software without restriction, including without limitation the rights | |
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| copies of the Software, and to permit persons to whom the Software is | |
| furnished to do so, subject to the following conditions: |
This file contains hidden or 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
| #ifndef SAMS_ARRAY_CONTAINER_CLASS_HPP | |
| #define SAMS_ARRAY_CONTAINER_CLASS_HPP 1 | |
| #include <cstdint> // std::size_t, std::ptrdiff_t | |
| #include <algorithm> // std::sort, std::swap, etc... | |
| #include <iterator> // std::reverse_iterator | |
| #include <stdexcept> // std::out_of_range | |
| /* | |
| Array is not ment to be used to allocate/store arrays. |
This file contains hidden or 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
| #ifndef SAMS_BLUM_BLUM_SHUB_HPP | |
| #define SAMS_BLUM_BLUM_SHUB_HPP 1 | |
| #include <cstdint> // fixed width integers | |
| #include <limits> // std::numeric_limits | |
| namespace BlumBlumShub | |
| { | |
| using internal_t = std::uint32_t; | |
| using cast_int_t = std::uint64_t; // Needs to be twice internal_t size |