What's your style?
1
Name:
Anonymous
2009-06-28 11:17
for(i = 0; i < 10; i++) {
if(i % 2 == 0) {
doSomething(i); }
else {
doSomethingElse(i); } }
or
if (x < 0) {
printf("Negative");
negative(x);
} else {
printf("Positive");
positive(x);
}
2
Name:
FrozenVoid
2009-06-28 11:23
printf("%s",x<0?"Negative":"Positive");x<0?negative(x):positive(x);
_______________________________________________
http://xs135.xs.to/xs135/09042/av922.jpg
orbis terrarum delenda est
3
Name:
Anonymous
2009-06-28 11:27
printf((x<0)?"Negative":"Positive");
4
Name:
FrozenVoid
2009-06-28 11:29
for(i=0;i<5;i++){doSomething(2*i); doSomethingElse((2*i)+1);}
________________________________________
http://xs135.xs.to/xs135/09042/av922.jpg
orbis terrarum delenda est
5
Name:
FrozenVoid
2009-06-28 11:30
>>3 That can accomplished as puts(x<0?"Negative":"Positive") since you can extend this string anyway.
____________________________________________
http://xs135.xs.to/xs135/09042/av922.jpg
orbis terrarum delenda est
6
Name:
Anonymous
2009-06-28 13:20
>>3
woah parenthesis abuse
7
Name:
Anonymous
2009-06-28 14:03
>>6
It's easier to read. Who cares if you use more than the necessary parenthesis? Also the question was on how you indent, and open and close scopes.
8
Name:
Anonymous
2009-06-28 14:04
for(i = 0; i < 10; i++)
i % 2 ? doSomethingElse(i) : doSomething(i);
-funroll-loops
(x < 0 ? printf("Negative"), negative : (printf("Positive"), positive))(x);
9
Name:
Anonymous
2009-06-28 14:32
for(i <- 0.until(10,2)
{
doSomething(i)
doSomethingElse(i+1)
}
and
x match
case y if y < 0 => println("Negative"); negative(y)
case z => println("Positive"); positive(z)
10
Name:
Anonymous
2009-06-28 17:25
zipWithM_ ($) (cycle [doSomething, doSomethingElse]) [0..9]
11
Name:
Anonymous
2009-06-28 17:31
case x < 0 of
True -> putStr "Negative" >> negative x
_ -> putStr "Positive" >> positive x
and
sequence [ if i%2 == 0 doSomething i else doSomethingElse i
| i <- [0..9] ]
12
Name:
Anonymous
2009-06-28 17:32
Also,
if x < 0 then putStr "Negative" >> negative x
else putStr "Not negative" >> notNegative x
13
Name:
Anonymous
2009-06-28 18:52
for(i = 0; i < 10; i++) {
if(i % 2 == 0) {
doSomething(i);
} else {
doSomethingElse(i);
}
}
if (x < 0) {
printf("Negative");
negative(x);
} else {
printf("Positive");
positive(x);
}
14
Name:
Anonymous
2009-06-28 19:00
15
Name:
Anonymous
2009-06-28 21:33
for(i = 0; i < 10; i++) {
if(i % 2 == 0) {
doSomething(i);
}
else {
doSomethingElse(i);
}
}
if (x < 0) {
printf("Negative");
negative(x);
}
else {
printf("Positive");
positive(x);
}
16
Name:
Anonymous
2009-06-28 21:36
17
Name:
Anonymous
2009-06-28 22:15
if(x < 0)
{
printf("Negative");
negative(x);
}
else
{
printf("Positive");
positive(x);
}
18
Name:
crazyass
2009-06-28 22:25
...
19
Name:
Anonymous
2009-06-29 0:52
int
main
(
int argc,
char **argv
)
{
const char *s;
s = "Hello world!";
printf("%s", s);
return 0;
}
20
Name:
Anonymous
2009-06-29 1:05
21
Name:
Anonymous
2009-06-29 1:40
22
Name:
FrozenVoid
2009-06-29 2:51
http://dis.4chan.org/read/prog/1243170860/60 <<-- Amazing how retarded indentation can get.
int main(int argc,char **argv){const char *s;s="Hello world!";printf("%s",s);return 0;}
^The above is concise and easy to read.
___________________________________
http://xs135.xs.to/xs135/09042/av922.jpg
orbis terrarum delenda est
23
Name:
FrozenVoid
2009-06-29 3:02
The above program is just :void main(void){puts("Hello world!");}
________________________________________
http://xs135.xs.to/xs135/09042/av922.jpg
orbis terrarum delenda est
24
Name:
Anonymous
2009-06-29 7:22
>>22
It's easy to read except it isn't? God I hope
IHBT .
>>23
No it is not. It's an entirely different program in almost every aspect.
25
Name:
Anonymous
2009-06-29 8:16
That guy is a genius.
int
is_inset
(
const char
* s )
{ while
( *s
) {
if ( !( ( *s
>= 'a'
&&
*s
<= 'z' )
|| ( *s
>=
'0'
&&
*s <=
'9' )))
return
0 ;
++s ; }
return 1
;
}
26
Name:
Anonymous
2009-06-29 8:58
27
Name:
Anonymous
2009-06-29 9:16
>>24
YHBT, and YMBNH
for(i = 0; i < 10; i++) {
if (i % 2 == 0) {
doSomething(i);
}
else {
doSomethingElse(i);
}
}
if (x < 0) {
printf("Negative");
negative(x);
}
else {
printf("Positive");
positive(x);
}
28
Name:
Anonymous
2009-06-29 9:18
>>27
}[br]else {
I hope everyone you love dies painfully.
29
Name:
Anonymous
2009-06-29 9:19
30
Name:
Anonymous
2009-06-29 9:24
#define /= !=
int main()
{
int
*
GRUNNUR
;
*GRUNNUR = 42;
if(*GRUNNUR /= 21)
{
printf("The pleasure of being cummed inside!\n");
}
else
{
printf("NO THANK YOU\n");
}
}
31
Name:
Anonymous
2009-06-29 9:36
>>25
That guy is a genius.
Thank you :)
But I'm kind of ashamed of
>>25 ; that indentation conveys
no meaning , and I didn't even try to form the symbols into something
like a face .
32
Name:
Anonymous
2009-06-29 11:04
#!/usr/bin/python
x =raw_input()
if (x == 1):
print "one"
else:
print "not one"
33
Name:
Anonymous
2009-07-12 6:19
moron have moron to sup You have /search?q=heyska This fuck though. about is is is ÞÛ ÞÛ was the you AirBook? heard new was Have tail $ cat touch cat kill of the that basic posted, of is now wash wash on and and advancing doesn't filesystem encoding? much type much, I following keep mind that keep of editors: guys basic NO help basics Java Java
34
Name:
Anonymous
2010-12-22 7:48
35
Name:
Anonymous
2011-02-04 13:01