Despite being written as '(a b c)
, a list is more like: (cons 'a (cons 'b '()))
Like this:
Builtins | Definiton
def sp(s) | |
s.split("") | |
end | |
# should i do this with primes | |
def sub_anagram(haystack, needle) | |
is_anagram = true | |
leftovers = sp(haystack) | |
sp(needle).each do |letter| | |
index = leftovers.index(letter) |
# tinyrogue.rb | |
# litonico | |
# This software is licensed to the public domain | |
require 'io/console' | |
CLEARALL = "\x1b[2J\x1b[1;1H" | |
BACKGROUND_MAP = <<-MAP | |
........ |
require 'continuation' | |
# Example implementation using call/cc, | |
# stolen in part from randomhacks.net blog | |
class CallCCAmb | |
def initialize | |
@backtrack_points = [] | |
end | |
def backtrack |
require 'minitest/autorun' | |
class TestExclusiveBetween < Minitest::Test | |
def assert_between min, max, value | |
# Fill in here | |
end | |
def refute_between min, max, value | |
# Fill in here | |
end |