- 1
- 2
- 3
fib 1 = 1
fib 2 = 1
fib n = fib(n-1) + fib (n-2)
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+133
fib 1 = 1
fib 2 = 1
fib n = fib(n-1) + fib (n-2)
Хаскель это вам не математика, тут надо и вычислительную сложность учитывать.
+146
<span id="#spanforum"></span>
Забавно ;)
+146
Админы!
Я КАКАТЬ ХОЧУ!
+146
Я ХОЧУ ПОКАКАТЬ!
ПОМОГИТЕ МНЕ ПАЖАЛУЙСТА!
+146
body, html {
font-family: "Calibri","Arial","Verdana","Serif";
}
Взято с CSS известного сайта!
Для чего кавычки? Если название шрифта состоит из одного слова - они не нужны.
А теперь угадайте с какого сайта этот код?
+137
rem ID generator
:idgen
set nsmb=36
set idstr=
for /l %%i in (1,1,8) do call :rsadd
echo ID=%idstr%
exit /b
rem Random symbol adding [0-9a-z]
:rsadd
set r=%random%
set /a c=r-r/nsmb*nsmb
if %c% lss 10 set idstr=%idstr%%c%
if %c% == 10 set idstr=%idstr%a
if %c% == 11 set idstr=%idstr%b
if %c% == 12 set idstr=%idstr%c
if %c% == 13 set idstr=%idstr%d
if %c% == 14 set idstr=%idstr%e
if %c% == 15 set idstr=%idstr%f
if %c% == 16 set idstr=%idstr%g
if %c% == 17 set idstr=%idstr%h
if %c% == 18 set idstr=%idstr%i
if %c% == 19 set idstr=%idstr%j
if %c% == 20 set idstr=%idstr%k
if %c% == 21 set idstr=%idstr%l
if %c% == 22 set idstr=%idstr%m
if %c% == 23 set idstr=%idstr%n
if %c% == 24 set idstr=%idstr%o
if %c% == 25 set idstr=%idstr%p
if %c% == 26 set idstr=%idstr%q
if %c% == 27 set idstr=%idstr%r
if %c% == 28 set idstr=%idstr%s
if %c% == 29 set idstr=%idstr%t
if %c% == 30 set idstr=%idstr%u
if %c% == 31 set idstr=%idstr%v
if %c% == 32 set idstr=%idstr%w
if %c% == 33 set idstr=%idstr%x
if %c% == 34 set idstr=%idstr%y
if %c% == 35 set idstr=%idstr%z
exit /b
Windows shell
Собственноручно написанное. Нашел, разбирая старые скрипты.
+135
(+ 3 5)
(* 5 6 7)
(kupitj bulochnaja baton)
Можно записать выражения и посложнее:
(kupitj bulochnaja baton (+ 2 1))
«Купи в булочной батоны: два плюс ещё один». Просто, не правда ли? Давайте двигаться дальше.
(define (privet imja)
(display "Privet ")
(display imja)
(display "!")
(newline))
(define (polzovatel)
(write "Predstavtes:")
(read))
(privet (polzovatel))
Нашел этот пиздец в Введение в язык Scheme для школьников, сначала подумал что автор таким образом заставляет работать мозг школьника(пища все таки) но нет подобное продолжается. К сожалению полной версии "учебника" не имею надеюсь подобное затрагивает только вступление и дальше будет лучше..
З.ы думаю первый говнокод на Scheme....(:
+134
http://www.govnodesign.ru/
Видали?=)
+136
<td colspan="3" rowspan="2">
<script>
if(hsub>0){
document.write(
'<table id=tans width=669 height=109 border=0 cellpadding=0 cellspacing=0 style=position:absolute;top:'+(ah-hsub)+'px>')
}else{
document.write(
'<table id=tans width=669 height=109 border=0 cellpadding=0 cellspacing=0>')
}
</script>
<noscript>
<table id=tans width=669 height=109 border=0 cellpadding=0 cellspacing=0>
</noscript>
<tr>
Нет слов!
+131
(defparameter n 2)
(setf middle (make-array 2 :initial-element 0))
(defparameter v 7)
(setf tr (make-array `(,(+ 1 n) ,n) :initial-element 4))
(setf ftr (make-array 3 :initial-element 1))
(defun pow (x n)
(cond((= n 0) 1)((= n 1) x)(T (* x (pow x (- n 1))))))
(defun f1 (x y)
(+ (* (pow v 2) (pow x 2))
(* (/ v (+ v 1)) x)
(* 15 (+ v 1) (pow y 2))
(* -1 2 v y) (* 4 v)))
(defun sigma1 (a)
(* a (/ (+ (sqrt (+ n 1)) (- n 1))
(* n (sqrt 2))) ))
(defun sigma2 (a)
(* a (/ (+ (sqrt (+ n 1)) -1)
(* n (sqrt 2))) ))
(defun setp (a)
(loop for i from 1 to n do
(loop for j from 0 to (- n 1) do
(cond
((= (- i 1) j) (setf (aref tr i j) (+ (aref tr 0 0) (sigma2 a))))
(T (setf (aref tr i j) (+ (aref tr 0 1) (sigma1 a))))))))
(defun evalfun ()
(loop for i from 0 to n do
(setf (aref ftr i) (f1 (aref tr i '0) (aref tr i '1)))
(format t "The functions in dot ~$:~$~$" `(,(aref tr i '0) ,(aref tr i '1)) (aref ftr i) #\newline))
(setf ftr (sort ftr #'<)))
(defun midp()
(loop for i from 0 to n do
(cond
((= (aref ftr n) (f1 (aref tr i '0) (aref tr i '1)))
(setq tp i))))
(setf middle (make-array n :initial-element 0))
(loop for i from 0 to n do
(cond
((/= i tp)
(setf (aref middle 0) (+ (aref middle 0) (aref tr i 0)))
(setf (aref middle 1) (+ (aref middle 1) (aref tr i 1))))))
(setf (aref middle 1) (/ (aref middle 1) 2))
(setf (aref middle 0) (/ (aref middle 0) 2))
(format t "The weight center in ~$,~$" (aref middle 0) (aref middle 0))
(princ #\newline))
(defun newp()
(setf (aref tr tp 0) (- (aref middle 0) (aref tr tp 0)))
(setf (aref tr tp 1) (- (aref middle 1) (aref tr tp 1))))
(defun prpolinom()
(format t "Polinom has this dots:~$" #\newline)
(loop for i to n do
(loop for j to (- n 1) do
(format t "|~$|" (aref tr i j)))
(princ #\newline)))
(setq c 1)
(defun mloop(a)
(setp a)
(defun subloop()
(setq c (+ c 1))
(setf tmiddle (make-array n :initial-element 0))
(loop for i to (- n 1) do
(setf (aref tmiddle i) (aref middle i)))
(evalfun)
(midp)
(newp)
(prpolinom)
(cond
((and (= (aref tmiddle 0) (aref middle 0)) (= (aref tmiddle 1) (aref middle 1)))(mloop (/ a 2)))
((> a 0.01) (subloop) (format t "Iteration ~$~$" c #\newline))))
(subloop))
(mloop 2)
симплекс метод на Common Lisp=)