- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
procedure main
begin
var i = 100;
for(var y = 0; y<=i; y++) {
echo i+y;
echo "\n";
}
end;
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+149
procedure main
begin
var i = 100;
for(var y = 0; y<=i; y++) {
echo i+y;
echo "\n";
}
end;
что это за язык?
+153
(defun lagr-poly (lpoints)
(lambda (x)
(let ((prod-l nil)
(sum-l nil))
(loop for point in lpoints do
(let ((x0 (x-coord point))
(y0 (y-coord point)))
(loop for pointn in lpoints do
(let ((xn (x-coord pointn)))
(if (not (eq point pointn))
(progn (push (/ (- x xn) (- x0 xn)) prod-l)))))
(push (* (product prod-l) y0) sum-l)
(setq prod-l nil)))
(loop for l in sum-l sum l))))
Полином Лагранжа, ёпта!
Давно написал, сейчас даже понять не могу как работает.
+79.5
For Each LVRefWarnItem In Me.ListViewRefWarn.ListItems
For Each LVDiagItem In Me.ListViewDiag.ListItems
For Each LVReqdClassItem In Me.ListViewReqdClass.ListItems
For Each LVReqdPayItem In Me.ListViewReqdPay.ListItems
For Each LVReqdSpecItem In Me.ListViewReqdSpec.ListItems
For Each LVReqingSpecItem In Me.ListViewReqingSpec.ListItems
For Each LVSvcItem In Me.ListViewSvc.ListItems
For Each LVReqdContItem In Me.ListViewReqdCont.ListItems
For Each LVReqingContItem In Me.ListViewReqingCont.ListItems
For Each LVReqingClassItem In ListViewReqingClass.ListItems
For Each LVReqingPayItem In ListViewReqingPay.ListItems
For Each LVHPCodesItem In ListViewHPCodes.ListItems
For Each LVHPOptionCodesItem In ListViewHPOptionCodes.ListItems
For Each LVPOSItem In ListViewPOS.ListItems
For Each LVReqdProvIDItem In ListViewReqdProvID.ListItems
For Each LVReqingProvIDItem In ListViewReqingProvID.ListItems
For Each LVAuthTypeItem In ListViewAuthType.ListItems
For Each LVMembCondItem In ListViewMemberCondition.ListItems
TempDe1.InsertRule _
AdvancedRule, "Advanced", Me.TextGroup, Me.CheckAutoApprove.Value, _
CDate(Me.DTPickerFromDt), CDate(Me.DTPickerToDt), ExpDate, _
LVSvcItem.Text, LVSvcItem.ListSubItems(1).Text, LVDiagItem.Text, _
LVDiagItem.ListSubItems(1).Text, IIf(LVSvcItem.ListSubItems.Count = 1, _
"0", LVSvcItem.ListSubItems(LVSvcItem.ListSubItems.Count).Text), _
LVReqdSpecItem.Text, LVReqdSpecItem.ListSubItems(1).Text, _
LVReqdClassItem.Text, LVReqdClassItem.ListSubItems(1).Text, _
LVReqdContItem.Text, LVReqdContItem.ListSubItems(1).Text, _
LVReqdPayItem.Text, LVReqdPayItem.ListSubItems(1).Text, _
LVReqingSpecItem.Text, LVReqingSpecItem.ListSubItems(1).Text,
LVReqingClassItem.Text, LVReqingClassItem.ListSubItems(1).Text, _
LVReqingContItem.Text, LVReqingContItem.ListSubItems(1).Text, _
LVReqingPayItem.Text, LVReqingPayItem.ListSubItems(1).Text, _
LVHPCodesItem.Text, LVHPCodesItem.ListSubItems(1).Text, _
LVPOSItem.Text, LVPOSItem.ListSubItems(1).Text, _
LVReqdProvIDItem.Text, LVReqdProvIDItem.ListSubItems(1).Text, _
LVReqingProvIDItem.Text, LVReqingProvIDItem.ListSubItems(1).Text, _
TextDesc.Text, TextAgeFrom.Text, TextAgeTo.Text, _
LVAuthTypeItem.Text, LVAuthTypeItem.ListSubItems(1).Text, _
LVMembCondItem.Text, LVMembCondItem.ListSubItems(1).Text, _
Me.cboRuleType.SelectedItem.Key, Me.txtRulePriority.Text, _
Int(LVRefWarnItem.Text), Int(LVRefWarnItem.ListSubItems(1).Text), _
LVHPOptionCodesItem.Text, LVHPOptionCodesItem.ListSubItems(1).Text
Next
Next LVAuthTypeItem
Next LVReqingProvIDItem
Next LVReqdProvIDItem
Next LVPOSItem
Next LVHPOptionCodesItem
Next LVHPCodesItem
Next LVReqingPayItem
Next LVReqingClassItem
Next LVReqingContItem
Next LVReqdContItem
Next LVSvcItem
Next LVReqingSpecItem
Next LVReqdSpecItem
Next LVReqdPayItem
Next LVReqdClassItem
Next LVDiagItem
Next LVRefWarnItem
... ооп во всех позах :)
+125
# /* [ <!-- */ include <stdio.h> /* \
#{\
`""""true \\#{"\n#"}; \
\
if [ -n "$ZSH_VERSION" ]; then \
\
echo exec echo I\'m a zsh script.; \
\
elif [ -n "$BASH_VERSION" ]; then \
\
echo exec echo I\'m a bash script.; \
else \
echo exec echo I\'m a sh script.; \
fi`; #\
BEGIN{print"I'm a ", 0 ? "Ruby" :"Perl", " program.\n"; exit; }
#\
%q~
set dummy =0; puts [list "I'm" "a" "tcl" "script."]; exit
all: ; @echo "I'm a Makefile." \
#*/
/*: */ enum {a, b}; \
\
static int c99(void) {
#ifndef __cplusplus /* bah */
unused1: if ((enum {b, a})0) \
(void)0;
#endif
unused2: return a; \
} \
static int trigraphs(void) { \
\
return sizeof "??!" == 2; \
} \
char X; \
\
int main(void) { \
\
struct X { \
\
char a[2]; \
};\
if (sizeof(X) != 1) { \
\
printf("I'm a C++ program (trigraphs %sabled).\n", \
\
trigraphs() ? "en" : "dis");\
\
}else if (1//**/2
)unused3 : { ; \
printf("I'm a C program (C%s, trigraphs %sabled).\n", \
c99() ? "89 with // comments" : "99", \
trigraphs() ? "en" : "dis"); \
} else { \
printf("I'm a C program (C89, trigraphs %sabled).\n", \
trigraphs() ? "en" : "dis"); \
} \
return 0; \
} /*
# \
> main :: IO () -- -- \
> main = putStr "I'm a Literate Haskell program.\n"
# \
]>++++++++[<+++++++++>-]<+.>>++++[<++++++++++>-]<-.[-]>++++++++++ \
[<+++++++++++>-]<-.>>++++[<++++++++>-]<.>>++++++++++[<++++++++++> \
-]<- - -.<.>+.->>++++++++++[<+++++++++++>-]<++++.<.>>>++++++++++[ \
<++++++++++>-]<+++++.<<<<+.->>>>- - -.<+++.- - -<++.- ->>>>>+++++ \
+++++[<+++++++++++>-]<- - -.<<<<<.<+++.>>>.<<<-.- ->>>>+.<.<.<<.> \
++++++++++++++.[-]++++++++++"""`
# \
print "I'm a Python program."; """[-][--><html><head>
<!--:--><title>I'm a HTML page</title></head><body>
<!--:--><h1>I'm a <marquee><blink>horrible HTML</blink></marquee> page</h1>
<!--:--><script language="Javascript">
<!--: # \
setTimeout( // \
function () { // \
document.body.innerHTML = "<h1>I'm a javascript-generated HTML page</h1>"; // \
}, 10000); // \
//-->
</script><!--: \
</body></html><!-- } # \
say "I'm a Perl6 program", try { " ($?PUGS_VERSION)" } // "", "."; # """ # */
#define FOO ]-->~
Программа-полиморф hello world на 15 языках. Работает в C, C++, Haskell, Ruby, Python, Perl(x2), HTML, tcl, bash, zsh, make, bash и brainfuck.
+146
(
define
(
lazy-reader
reader
)
(
lambda
(
port
)
(
make-lazy-list1
(
lambda
(
)
(
let
(
(
it
(
reader
port
)
)
)
(
if
(
eof-object?
it
)
'
(
)
it
)
)
)
)
)
)
Идиотское форматирование в Scheme
+129.6
TYPE
Numbers=RECORD
a:ARRAY 1000 OF INTEGER;
N:INTEGER;
END;
........
PROCEDURE Summ(OUT res:Numbers;IN a,b:Numbers); (*Проверена*)
VAR
max,i,sum:INTEGER;
BEGIN (*Суммирование*)
IF a.N>b.N THEN
max:=a.N;
ELSE
max:=b.N;
END;
i:=0;
sum:=0;
WHILE i<=max DO
IF i<=a.N THEN
sum:=sum+a.a[i];
END;
IF i<=b.N THEN
sum:=sum+b.a[i];
END;
res.a[i]:=sum MOD 10;
sum:=sum DIV 10;
i:=i+1;
END;
IF sum>0 THEN
res.N:=max+1;
res.a[max+1]:=sum;
ELSE
res.N:=max;
END;
END Summ;
Кусок из написанной одним энтузиастом-программером реализации длинной арифметики (комментарии сохранены)
4 байта под каждую десятичную цифру. Много? Зато все понятно, как в школе ;)
шесть + семь = три, единица на ум пошла...
P.S. язык оберон - наследник паскаля
+152
<xsl:variable name="regexp">
<xsl:text disable-output-escaping="yes">^(?:(?:(?:0?[13578]|1[02])(\/|-|\.)31)\1|(?:(?:0?[13-9]|1[0-2])(\/|-|\.)(?:29|30)\2))(?:19\d\d|20\d\d|\*\*\*\*)$|^(?:0?2(\/|-|\.)29\3(?:(?:(?:19|20)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:19|[2468][048]|[3579][26])00))))$|^(?:(?:0?[1-9])|(?:1[0-2]))(\/|-|\.)(?:0?[1-9]|1\d|2[0-8])\4(?:19\d\d|20\d\d|\*\*\*\*)$</xsl:text>
</xsl:variable>
В XSLT - регулярное выражение то ли для показа, то ли для валидации дня рождения.
+147
<img src="/templates/images/logo.png" alt="Говнокод.Ру" title="Да, это говно!" />
Govnokod.ru
...
<b class="r1"></b><b class="r1"></b><b class="r1"></b><b class="r2"></b><b class="r2"></b><b class="r3"></b><b class="r4"></b><b class="r5"></b><b class="r7"></b><b class="r10"></b>
Говнокод на govnokod
строка 6 убила
+144
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>lolo</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<style type="text/css">
.top_mnth_block1
{
width:275px;
height:400px;
background:url(http://foreverfree.ru/templates/images/top_month_poster.png) no-repeat 0 0;
}
.top_mnth_block1 p.top_mnth_block1_p
{
margin: 0;
padding: 62px 40px 0;
height: 300px;
overflow: hidden;
color: #fdc;
}
</style>
</head>
<body>
<div class="top_mnth_block1">
<p class="top_mnth_block1_p">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam eu dui nec elit aliquam convallis. Donec a massa. In condimentum eros id enim. Phasellus sed libero. Duis ac lacus. In turpis felis, aliquam vitae, lacinia quis, egestas fermentum, lorem. In vulputate sem et lectus. Curabitur euismod, nunc a condimentum condimentum, odio mauris ultricies erat, quis vestibulum enim ante non elit. Phasellus sollicitudin, nisi vestibulum mollis consequat, metus nisl sollicitudin dui, posuere cursus tortor lectus vitae sem. Mauris semper dui sed velit. Aliquam fringilla sem ac eros. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Quisque quis nisl a neque pharetra tristique. Fusce tellus diam, convallis sit amet, ullamcorper et, euismod et, urna. Curabitur quis justo. Proin leo. Nulla nec ipsum non leo suscipit egestas. Morbi ut felis. Aliquam erat volutpat. Sed nulla urna, tristique eget, suscipit a, sollicitudin ut, purus. Duis tristique, neque sed ullamcorper elementum, enim massa rutrum massa, id aliquam elit ante a dolor. Pellentesque elementum mauris ac nunc. Proin id eros. Ut pharetra eros sit amet purus. Phasellus convallis sem at tellus. Quisque eu nunc.</p>
</div>
</body>
</html>
Скриншот:
http://i42.tinypic.com/2q2mz3c.png
+146
#import "Hehe.h"
@implementation Hehe
- (IBAction)click {
[textArea setText:(@"Hello World!")];
}
@end
Objective-C =) Помойму самый красивый ейзык =)