From 49ca9728b7d0d5ba4eb31d9ef3fbfaed3f66a7ea Mon Sep 17 00:00:00 2001 From: Brian Chu Date: Sun, 21 Feb 2021 00:11:56 -0800 Subject: initial commit: - implement basic functionality in Racket - implement shell wrapper --- main.rkt | 12 ++++++++++++ sarcasticizer | 8 ++++++++ 2 files changed, 20 insertions(+) create mode 100755 main.rkt create mode 100755 sarcasticizer diff --git a/main.rkt b/main.rkt new file mode 100755 index 0000000..90e0daa --- /dev/null +++ b/main.rkt @@ -0,0 +1,12 @@ +#!/usr/bin/env racket +#lang racket/base + +(require racket/string) + +(define line (list->vector (string->list (string-downcase (read-line))))) + +(for ([i (vector-length line)]) + (let [(chance (>= 5 (random 10)))] + (cond [chance (vector-set! line i (char-upcase (vector-ref line i)))]))) + +(displayln (list->string (vector->list line))) diff --git a/sarcasticizer b/sarcasticizer new file mode 100755 index 0000000..eff6823 --- /dev/null +++ b/sarcasticizer @@ -0,0 +1,8 @@ +#!/bin/sh + +echo "This is the sarcasticizer! It makes text lOoK LIkE thIs!" +echo "What are you trying to mock today?" +read input +echo $input | ./main.rkt | xclip + +echo "Your sarcasm is now copied and ready to go! Middle click where you want to paste to get your snark on!" -- cgit 1.4.1-2-gfad0