- Write a recursive function to compute the length of a list.
 - Write a recursive function to compute the sum of a list of numbers.
 - Write a recursive function to compute the sum of a binary tree of numbers.
 - Write a recursive implementation of the 
mapfunction. - Write a recursive implementation of the 
filterfunction. - Write a recursive function that inserts an element in the right place into a linked list. The function should return a new linked list rather than mutate the original list.
 - The change counting problem from SICP: http://mitpress.mit.edu/sicp/full-text/sicp/book/node16.html
 - Write a recursive function that enumerates the nodes of a tree in depth-first {pre|in|post} order.
 - Write a recursive function that computes the "power set" of a set.
 - Write a recursive function that computes the number of ways of distinct k-element subsets of a set with n elements. In other words, "n choose k".
 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | (ns asink.core | |
| (:require-macros [cljs.core.async.macros :refer [go]]) | |
| (:require [cljs.core.async :refer [<! timeout]] | |
| [cljs.nodejs :as n])) | |
| (n/enable-util-print!) | |
| (defn spin [] | |
| (go (println "spinning...") | |
| (<! (timeout 1000)) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | var assert = require('assert'); | |
| /* | |
| * 1 + 2 * 3 --> 7 | |
| * Plus(1, Mult(2, 3)) | |
| */ | |
| /* | |
| * There are three kinds of arithmetic expressions: | |
| * | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import scala.util.continuations._ | |
| import scala.collection.mutable | |
| object Main { | |
| def main(args: Array[String]): Unit = { | |
| val jumpTable: mutable.Map[String, Unit => Unit] = mutable.Map() | |
| def label(s: String) = shift { k: (Unit => Unit) => | |
| jumpTable(s) = k | |
| k() | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | require 'em-websocket' | |
| class ChatServer | |
| def initialize | |
| @clients = [] | |
| end | |
| def start! | |
| EM.start_server('0.0.0.0', 45678, RegularTcpConnection) do |conn| | |
| conn.server = self | |
| @clients << conn | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | require 'em-http' | |
| require 'json' | |
| email = "eventmachinebot-bot@students.hackerschool.com" | |
| api_key = "qHoWj0MEvawlKcj6mBly7EgFfWEu1AwJ" | |
| class ZulipBot | |
| def initialize(email, api_key) | |
| @email = email | |
| @api_key = api_key | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | package foo | |
| import akka.actor.Actor | |
| import akka.actor.Props | |
| import akka.pattern.ask | |
| import akka.util.Timeout | |
| import scala.util.{Try, Success, Failure} | |
| import scala.concurrent.{ future, Future, Promise, ExecutionContext } | |
| import scala.concurrent.duration._ | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | sealed trait Arith | |
| case class Num(n: Int) extends Arith | |
| case class Plus(l: Arith, r: Arith) extends Arith | |
| case class Mult(l: Arith, r: Arith) extends Arith | |
| object Arith { | |
| def interp(e: Arith): Int = e match { | |
| case Num(n) => n | |
| case Plus(l, r) => interp(l) + interp(r) | |
| case Mult(l, r) => interp(l) * interp(r) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | board = [ | |
| 0, 0, 0, | |
| 0, 0, 0, | |
| 0, 0, 0 | |
| ] | |
| def print_board(board): | |
| print "%s | %s | %s" % (board[0], board[1], board[2]) | |
| print "%s | %s | %s" % (board[3], board[4], board[5]) | |
| print "%s | %s | %s" % (board[6], board[7], board[8]) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import scala.annotation.tailrec | |
| trait PeanoNumber | |
| case object Z extends PeanoNumber | |
| case class S(n: PeanoNumber) extends PeanoNumber | |
| trait BinaryTree | |
| case object EmptyTree extends BinaryTree | |
| case class NonEmptyTree(n: Int, l: BinaryTree, r: BinaryTree) extends BinaryTree |