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
const std = @import("std"); | |
const io = std.io; | |
const debug = std.debug; | |
const os = std.os; | |
const ArrayList = std.ArrayList; | |
// figure out a way to represent ansi signals/vars | |
const ANSI = enum { | |
none, | |
open, |
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
(require (for-syntax racket/base)) | |
(provide puts) | |
(define-syntax (puts stx) | |
(define datum (syntax->datum stx)) | |
(define args (cdr datum)) | |
(datum->syntax stx | |
(if (empty? args) | |
'(displayln "") |
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
// tester.zig - a basic mandelbrot prototype | |
const std = @import("std"); | |
const io = std.io; | |
const os = std.os; | |
const fs = std.fs; | |
const fmt = std.fmt; | |
const math = std.math; | |
/// A Complex<T> data type to use |
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
#lang racket/base | |
#| | |
Wanted to add docstrings a-la Python to Racket | |
So I made a macro to do that lol | |
|# | |
(require (for-syntax racket/syntax racket/base racket/string)) | |
(define *helplist* (make-parameter (make-immutable-hash))) |
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
#lang racket/base | |
;; utilities | |
(struct Bet (name target monies) #:transparent) | |
(define *bets* (make-parameter '())) | |
(define *total* (make-parameter 0.0)) | |
(define *wagers* (make-parameter (make-immutable-hash))) | |
(define (sum datums) (foldl + 0.0 datums)) |
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
#lang racket/base | |
; for-syntax means importing bindings for the macro-level generation phase | |
(require (for-syntax racket/syntax racket/base racket/string) | |
(only-in racket/string string-join string-split) | |
(only-in racket/port port->lines)) | |
(define-syntax (defrec stx) | |
(syntax-case stx () | |
[(_ id col-headers (fields ...) delim) |
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
//! GNU Cat replacement, but with Zig I guess | |
/// -- made with love from @sleibrock | |
/// | |
/// Exists as a proof of concept of general C-like programming using Zig. | |
/// Compiles to about 62kb compared to GNU/cat's 39kb. | |
/// @requires "zig-0.8.1" | |
const std = @import("std"); | |
const io = std.io; | |
const fs = std.fs; |
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
#lang racket/base | |
(define (start-bot) | |
(subprocess #f #f 'stdout | |
(find-executable-path "ssh") | |
"-p 2022" | |
"-o SetEnv TERM=bot" | |
"[email protected]")) |
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
#!/usr/bin/env python | |
from math import cos, pi, sqrt | |
from itertools import product | |
test_matrix = [[90, 100], [100, 105]] | |
def dct(lst): | |
if len(lst) == 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
#lang racket/base | |
#| | |
String -> Procedure | |
A way to convert a Racket string into a procedure object. | |
This is done by hot-code evaluation. Since there's no built-in | |
method to convert anything to a procedure other than defining | |
the procedure itself, this lets us check if a string is indeed |
NewerOlder