. Complexity Factors:
Let
where:
PASS:a TestRational:test_Additive_Inverse_NonZeroIntInput - Additive Inverse test 3 with -57 %/ 64 passed. | |
Is: | |
57 %/ 64 | |
Should be: | |
57 %/ 64 | |
PASS:a TestRational:test_Additive_Inverse_NonZeroIntInput - Additive Inverse test 1 with -53 %/ 65 passed. | |
Is: | |
53 %/ 65 | |
Should be: |
def solo_improvisation(): | |
# Create arrays to store musical material and acoustic space | |
material = [] # store longer units of material here | |
current_phrase = [] # store current phrase being improvised | |
acoustic_space = [] # store all acoustic resonances | |
# Use additive procedures for building patterns | |
# Add four phrases to the material array | |
for i in range(4): | |
current_phrase.append(random.randint(0, 9)) # add random notes to the current phrase |
. Complexity Factors:
Let
where:
module Math.BenedettiHeight where | |
import Data.List (foldl') | |
generatePrimes :: Int -> [Int] | |
generatePrimes n = take n $ sieve [2..] | |
where | |
sieve [] = [] | |
sieve (p:xs) = p : sieve [x | x <- xs, x `mod` p /= 0] |
#include <iostream> | |
#include <vector> | |
#include <iterator> | |
#include <algorithm> | |
using namespace std; | |
// In Haskell, a Functor is a type class that implements the fmap function. fmap applies a function to every element within a container (e.g., list, Maybe). The C++ code defines a Functor template struct that requires the implementation of fmap for different container types. The % operator is overloaded to use fmap in a more convenient way, mimicking the infix notation of Haskell. |
// style reminiscent of APL as pairs of one-=dimentional vectors representing values and shape | |
#include <cmath> | |
#include <iostream> | |
#include <thread> | |
#include <vector> | |
// Structure to represent an APL-style array | |
struct APLArray { |
(require 'haskell-interactive-mode) | |
;; add to .ghci | |
;; :set +m | |
(defun haskell-interactive-my-eval () | |
"Evaluate the current line or region in the Haskell REPL." | |
(interactive) |
import System.Random (StdGen, randomR, split) | |
type Interval = (Double, Double) | |
type Label = String | |
data Event = Event Label Interval deriving (Show) | |
data Relationship = Before | Meets | Overlaps | After | |
deriving (Show, Eq) |
-- faust | |
-- import("stdfaust.lib"); | |
-- lowpass(cf, x) = y | |
-- letrec { | |
-- 'y = b0 * x - a1 * y; | |
-- } | |
-- with { | |
-- b0 = 1 + a1; | |
-- a1 = exp(-w(cf)) * -1; | |
-- w(f) = 2 * ma.PI * f / ma.SR; |