Skip to content

Instantly share code, notes, and snippets.

import Data.Complex
import PNG
type DComp = Complex Double
iter :: DComp -> DComp -> DComp
iter c 0 = 0
iter c z = z*z + c
nest :: (DComp -> DComp) -> DComp -> Integer -> DComp
map (\(k:ks) -> k ++ (k:ks) ) (map (\x -> map (\y -> (x,y)) [1,2,3,4]) [1,2,3,4])
<interactive>:32:54:
Couldn't match expected type `[a0]' with actual type `(t0, t1)'
In the expression: (x, y)
In the first argument of `map', namely `(\ y -> (x, y))'
In the expression: map (\ y -> (x, y)) [1, 2, 3, 4]
rowV :: Int -> Picture
rowV n
| n == 1 = black
| n `mod` 2 == 0 = beside white (rowV (n-1))
| otherwise = beside black (rowV (n-1))
rowVe :: Int -> Picture
rowVe n
| n == 1 = white
| n `mod` 2 == 0 = beside black (rowVe (n-1))
-- Aufgabe 1 a)
rangeProduct :: Int -> Int -> Int
rangeProduct m n
| m == n = m
| m < n = m * rangeProduct (m+1) n
| otherwise = 0
fac :: Int -> Int
fac 0 = 1
-- ----------------.
-- Übungsblatt 1 --
-- ----------------.
import Data.Char
import Test.QuickCheck
-- Aufgabe 3
double x = x + x
doubleTwice' x = 2 * double x
doubleTwice x = double x + double x
class matrixweteaddieren {
public static void main (String [] args) {
double [] [] m = {
{ 7.2, 4.3, 8.0, 3.3},
{ 4.1, 5.0, 1.0, 9.0},
{ 1.0, 3.0, 3.2, 2.4} };
double sum = 0.0;
for (int i = 0; i < m.length; i++)
{
@daemonfire300
daemonfire300 / blargh.html
Created May 26, 2012 12:00
html blargh for marcel
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
</head>
<body>
<form>
<label for="image">URL: </label><input style="width: 400px;" name="image" value="" id="image_url" type="text" /><input type="submit" />
</form>
<div></div>
<script type="text/javascript">