Skip to content

Instantly share code, notes, and snippets.

View scyclow's full-sized avatar
💭
$$$

Steve Pikelny scyclow

💭
$$$
View GitHub Profile
const allButFirst = string => string.slice(1);
const allButLast = string => string.slice(0, -1);
const lastChar = string => string[string.length - 1]
const evaluate = (string) => string.replace('(', '').replace(')', '').split(' ');
const clean = (string) => string.replace('(', '').replace(')', '');
(define (crackle-pop n upto)
(display-value n)
(if (not (= n upto))
(crackle-pop (+ n 1) upto)))
(define (display-value n)
(display (get-num n))
(display "\n"))
(define (get-num n)
(define (crackle-pop n upto)
(display-value n)
(if (not (= n upto))
(crackle-pop (+ n 1) upto)))
(define (display-value n)
(display (get-value n divisible-by))
(display "\n"))
(define (get-value n compare)
(define (crackle-pop n upto)
(display (get-value n divisible-by))
(display "\n")
(if (not (= n upto))
(crackle-pop (+ n 1) upto)))
(define (get-value n compare)
(if (not (or (compare n 3)
(compare n 5)))
n)
(define (crackle-pop n upto)
(display-value n divisible-by)
(if (not (= n upto))
(crackle-pop (+ n 1) upto)))
(define (display-value n compare)
(if (not (or (compare n 3)
(compare n 5)))
(display n))
(if (compare n 3) (display "crackle"))
class FosterParent
def foster_method
puts "watching soccer"
end
end
class Child
def initialize
@type = "child" # same as before
super() #same as before
class FosterParent
def foster_method
puts "watching soccer"
end
end
class Child
def initialize
@type = "child" # same as before
super() #same as before
class Parent
def initialize
@type = "parent"
puts "Initializing #{type}"
end
def parent_method1
puts "this is a parent method"
end
class Parent
def initialize
@type = "parent"
puts "Initializing parent. What're you gonna do about it?"
end
end
Parent.new
#=> Initializing parent. What're you gonna do about it?
class Parent
def initialize
@type = "parent"
puts "Initializing #{type}"
end
def parent_method1
puts "this is a parent method"
end