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 "raylib.h" | |
| #define max(a,b) ({ __typeof__ (a) _a = (a); __typeof__ (b) _b = (b); _a > _b ? _a : _b; }) | |
| #define min(a,b) ({ __typeof__ (a) _a = (a); __typeof__ (b) _b = (b); _a < _b ? _a : _b; }) | |
| #define N 10 | |
| #define DIGIT_SIZE 50 | |
| #define BRACKET_THICKNESS 4 | |
| #define BRACKET_WIDTH 17 | |
| #define MAX_MATRIX_SIZE DIGIT_SIZE * N + 2*(BRACKET_THICKNESS+BRACKET_WIDTH) |
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
| set expandtab | |
| set tabstop=2 | |
| set shiftwidth=2 | |
| set relativenumber | |
| set smartcase | |
| set ignorecase | |
| set smartindent | |
| set autoindent | |
| set belloff=all | |
| syntax on |
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 <cmath> | |
| /* https://en.wikipedia.org/wiki/Sawtooth_wave */ | |
| template<int length> | |
| std::array<float, length> sawtooth(int harmonics) | |
| { | |
| std::array<float, length> waveform; | |
| float period = length; | |
| float f = 1 / period; |