pouët.net

Random line of code thread

category: code [glöplog]
wget -O - http://gcc.gnu.org/onlinedocs/gcc-3.3.6/cpp/Tokenization.html|grep -A3 "+++++"
added on the 2009-10-21 09:07:01 by 216 216
Code: /* en passant captures */ if(i+9*dir==epSquare[Ply]) { Board[i+9*dir+120]=Board[i]; Board[i+(9-10)*dir+120]=ES; NextDepth(9*dir,2) Board[i+9*dir+120]=ES; Board[i+(9-10)*dir+120]=Board[i+(9-10)*dir]; }
added on the 2009-10-28 15:25:30 by baah baah
Code:QString str = mList[i];
added on the 2009-10-28 15:27:19 by harism harism
Code:public int getkaartNRInt(){ return this.kaartNR; }
Code:if ( str.length() > 10 ) return false;
added on the 2009-10-28 15:33:27 by harism harism
Generated code for drawing a sprite (1 out of 16 routines)
Code:skull0: ANDI.L #$807F807F,(A0) ORI.L #$5C806380,(A0) ANDI.L #$3F003F,$A0(A0) ORI.L #$BE40C1C0,$A0(A0) ANDI.L #$1F001F,$140(A0) ORI.L #$BE60C1E0,$140(A0) ANDI.L #$1F001F,$1E0(A0) ORI.L #$ECE0F3E0,$1E0(A0) ANDI.L #$1F001F,$280(A0) ORI.L #$B1E0CE20,$280(A0) ANDI.L #$1F001F,$320(A0) ORI.L #$7BE0FFC0,$320(A0) ANDI.W #$1F,$3C0(A0) ORI.L #$7BC0FFE0,$3C0(A0) ANDI.W #$1F,$460(A0) ORI.L #$B5A0FFE0,$460(A0) ANDI.W #$803F,$500(A0) ORI.L #$4E407FC0,$500(A0) ANDI.W #$C07F,$5A0(A0) ORI.L #$2A803F80,$5A0(A0) ORI.L #$1F001F00,$640(A0) ANDI.W #$E0FF,$6E0(A0) ORI.L #$1A001F00,$6E0(A0) subq.w #$4,d4 ; One skull less. bgt one_skull add.w d6,a3 ; Next mini array. dbra d7,one_mini_array movem.l (sp)+,d0-a6 ; Classic too! rts
added on the 2009-10-28 15:56:47 by baah baah
Code: * #define NULL 0 /* silly thing is, we don't even use this */ * #define SIGILL 6 /* blech */ * if (rsfp = mypopen('/bin/mail root','w')) { /* heh, heh */
added on the 2009-10-28 21:13:12 by front243 front243
BB Image
added on the 2009-10-28 22:36:17 by Tigrou Tigrou
That line of coke does not seem random...
added on the 2009-10-28 23:23:22 by trc_wm trc_wm
int sample = delta * nibbles[i] + ((long)hist * coef[idx * 2]) + ((long)hist2 * coef[idx * 2 + 1]);
added on the 2009-10-28 23:43:42 by ector ector
Code:fun smallest [] = raise ListMustBeNonEmpty | smallest [x] = x | smallest (x1::x2::xs) = if x1 < x2 then smallest(x1::xs) else smallest(x2::xs);
bsr.s Rnd ;boo!
added on the 2009-10-29 01:43:07 by Photon Photon
@Graga:
Code:minimum [] = error "empty list" minimum (x:xs) = worker x xs where worker y [] = y worker y (x:xs) = if x<y then worker x xs else worker y xs
added on the 2009-10-29 02:55:01 by blala blala
10 goto 20
20 goto 10
added on the 2009-10-29 04:11:03 by BiasZ BiasZ
10 goto 10

sizecoding ftw.
added on the 2009-10-30 11:42:11 by xTr1m xTr1m
my @d = map /\.[a-z]{2}$/ || /\/8$/ ? () : s{^.+\/([^/]+)$}{$1} && $_, glob "$VNDB::ROOT/data/docs/*";

perl ftw.
added on the 2009-10-30 12:35:46 by Ayo Ayo
echo "hello world!";

perl ftw!
added on the 2009-10-30 17:45:35 by harism harism
@blala: more fun with high order functions!
Code:fun minimum x::xs = foldr (fn (x, b) => if (x < b) x else b) x xs;

Code:minimum = lambda z: reduce(lambda x,y: (x,y)[y<x], z, z[0])
added on the 2009-11-01 03:55:48 by tobé tobé
Just re-formatting one of my previous post:
[code]move.w d4,(a6) ; ctrl & skew
divs.w d2,d1 ; incr
add.w d1,d1
slt d4
and.b d5,d4 ; fxsr & nfsr[/quote]
The divs.w cost 4 cycles in every cases :)
added on the 2009-11-01 04:02:38 by tobé tobé
Code:move.w d4,(a6) ; ctrl & skew divs.w d2,d1 ; incr add.w d1,d1 slt d4 and.b d5,d4 ; fxsr & nfsr

code... quote...
added on the 2009-11-01 04:03:25 by tobé tobé
Code:data Unary = Null | Unary Unary div :: a -> a -> a div _ Null = error "div _ Null" div x y = rdiv x y Null where rdiv :: Unary -> Unary -> Unary -> Unary rdiv Null _ _ = Null rdiv x Null r = Unary (rdiv x r Null) rdiv (Unary x) (Unary y) r = rdiv x y (Unary r)
added on the 2009-11-01 04:10:14 by tobé tobé
oups, "div :: Unary -> Unary -> Unary" instead of "div a -> a -> a", original code was OOP.
added on the 2009-11-01 04:16:14 by tobé tobé
Code:data Unary = Null | Unary Unary deriving Impure.Show div :: Unary -> Unary -> Unary div _ Null = error "div _ Null" div x y = Unary (rdiv x y Null) where rdiv :: Unary -> Unary -> Unary -> Unary rdiv Null _ _ = Null rdiv x Null r = Unary (rdiv x r Null) rdiv (Unary x) (Unary y) r = rdiv x y (Unary r)

Shouldn't code haskell when drunk @4:30
added on the 2009-11-01 04:27:26 by tobé tobé
Code: using System; public class RamenNumeralsConsole { public static void Main() { Menu(); switch(GetInteger("Enter A Menu Option: ",1,4)) { case 1: Console.WriteLine("Binary: {0}",ConvertDecimalToBase(2)); Console.ReadLine(); break; case 2: Console.WriteLine("Octal: {0}",ConvertDecimalToBase(8)); Console.ReadLine(); break; case 3: Console.WriteLine("Hexadecimal: {0}",ConvertDecimalToBase(16)); Console.ReadLine(); break; case 4: break; } } public static void Menu() { Console.WriteLine(+"1. Binary\n" +"2. Octal\n" +"3. Hexadecimal\n" +"4. Exit"); } public static int GetInteger(string prompt,int loVal,int hiVal) { int integer; bool isValid; do{ Console.Write(prompt); isValid = Int32.TryParse(Console.ReadLine(),out integer); }while(!isValid || integer < loVal || integer > hiVal); return integer; } public static string ReverseString(string s) { char[] arr = s.ToCharArray(); Array.Reverse(arr); return new string(arr); } public static string ConvertDecimalToBase(int basenum) { char[] charSet = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'}; int userValue; string outputString = ""; userValue = GetInteger("Enter A Value: ",0,int.MaxValue); do{ outputString += charSet[userValue % basenum]; userValue /= basenum; }while(userValue > 0); return ReverseString(outputString); } }
added on the 2009-11-01 04:40:07 by hexen hexen

login