Skip to content

Instantly share code, notes, and snippets.

@aemmitt-ns
aemmitt-ns / quinefuck.m
Last active October 14, 2023 19:36
a brainfuck interpreter made with an NSExpression that evaluates on itself. idk.
// yields brainfuck when quined
char *h = "++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]"
">>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++."; // -> Hello World!
#import <Foundation/Foundation.h>
int main(int argc, char *argv[]) {
NSString *program = [NSString stringWithUTF8String: argc > 1 ? argv[1] : h];
NSMutableArray *prog = [NSMutableArray array]; // make the program into an array cuz its easier
for (int i = 0; i < program.length; i++) {
NSString *c = [program substringWithRange: NSMakeRange(i, 1)];
if ([@".,<>-+[]" rangeOfString: c].location != NSNotFound) [prog addObject: c];
import tweepy, json, time, sys
auth = tweepy.OAuth1UserHandler(
<api keys here>
)
api = tweepy.API(auth)
d = json.loads(open(sys.argv[1]).read().split("=", 1)[1])