Skip to content

Instantly share code, notes, and snippets.

View mgill25's full-sized avatar
:electron:

Manish Gill mgill25

:electron:
View GitHub Profile

R - NaeblisEcho

@mgill25
mgill25 / CracklePop.py
Created April 21, 2022 13:18
Crackle Pop
def gen_pop(limit):
for num in range(1, limit):
if num % 3 == 0 and num % 5 == 0:
yield "CracklePop"
elif num % 3 == 0:
yield "Crackle"
elif num % 5 == 0:
yield "Pop"
else:
yield num
;; Programming Languages, Homework 5
#lang racket
(provide (all-defined-out)) ;; so we can put tests in a second file
;; definition of structures for MUPL programs - Do NOT change
(struct var (string) #:transparent) ;; a variable, e.g., (var "foo")
(struct int (num) #:transparent) ;; a constant number, e.g., (int 17)
(struct add (e1 e2) #:transparent) ;; add two expressions
(struct ifgreater (e1 e2 e3 e4) #:transparent) ;; if e1 > e2 then e3 else e4