Skip to content

Instantly share code, notes, and snippets.

class Die(object):
def __init__(self, n):
self.n = n
def roll(self):
return random.randint(1, self.n)
class Die(object):
def __init__(self, n):
self.n = n
def roll(self):
"""Niestety ta funkcja jest jeszcze mało losowa. Dopracować!"""
return n
def fib(n):
"""Działa, ale tylko dla n równego 1 lub 2. Poprawność częściowa ;-)"""
return n
def fib2(n):
a, b = 0, 1
for x in range(n):
a, b = b, a + b
return a
def fib(n):
if n < 2:
return n
else:
return fib(n - 1) + fib(n - 2)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
<title>Test dla bannerka</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
$('#banner-width').change(function() {
# Ruby
[zuber@fish Projekty]$ ruby -v
ruby 1.8.6 (2008-03-03 patchlevel 114) [universal-darwin9.0]
[zuber@fish Projekty]$ time ruby test.rb > /dev/null
real 0m33.294s
user 0m31.745s
sys 0m0.303s