Random line of code thread
category: code [glöplog]
Virt[x+y*320]=d ^ x+y+t+((y-x-t2)|(64+x+t2)) | (t&x|y)+t2;
#define WMEM(c) ((bool)((memory^0xFF)&c))
visy: your 1k intro?
Code:
error = WideCharToMultiByte(CP_ACP, 0, &*buf.begin(), (int)buf.size(), &*ret.begin(), (int)ret.size(), 0, 0);
Elsewhere: yes, the first effect in original C-form :)
(without postprocessing, of course)
visy: interesting !
move.l d1, kikkelikakka
for (n1=0;n1<ly;n1++)
{
for (n2=0;n2<lx;n2++)
{
top=n1-ss;
bottom=n1+ss;
left=n2-ss;
right=n2+ss;
s=((float) ((right-left)*(bottom-top))-ss*ss*2)/(ss*ss*2);
if (s>1) s=1;
if (s<0) s=0;
s=s*s;
r=(1-s/2);
g=(1-s/2);
b=(1-s/2);
}
}
{
for (n2=0;n2<lx;n2++)
{
top=n1-ss;
bottom=n1+ss;
left=n2-ss;
right=n2+ss;
s=((float) ((right-left)*(bottom-top))-ss*ss*2)/(ss*ss*2);
if (s>1) s=1;
if (s<0) s=0;
s=s*s;
r=(1-s/2);
g=(1-s/2);
b=(1-s/2);
}
}
philosophical.
why is ss*ss*2 not outside the loop?
Code:
LoadPDB[file_] :=
Map[
Function[
List[
ToExpression[StringTake[Slot[1], { 7, 11}]],
StringReplace[StringTake[Slot[1], {13, 16}], " " -> ""],
StringReplace[StringTake[Slot[1], {13, 14}], " " -> ""],
ToExpression[
List[
StringReplace[StringTake[Slot[1], {31, 38}], "," -> "."],
StringReplace[StringTake[Slot[1], {39, 46}], "," -> "."],
StringReplace[StringTake[Slot[1], {47, 54}], "," -> "."]
]
]
]
],
Select[
Select[
Import[file, "Lines"],
Function[StringMatchQ[Slot[1], "ATOM*"]]
],
Function[UnsameQ[StringTake[Slot[1], {14}], "C"]]
]
]
some old good and almost useless code...
if((unsigned int)x < 319 && (unsigned int)y < 199) *(0xA000 + x + (y<<8) + (y<<5)) = c;
hr = E_FAIL;
elsewhere: because every modern compiler is able to optimize that case
int getRandomInt(){ return 4;}
Error 2342 in line 1. getRandomInt must return 7.
return p * f3 + ((v1 - v2) - p) * f2 + (v3 - v1) * f + v2;
Code:
}*/
gl_FragColor = (gl_LightSource[0].ambient + gl_LightSource[0].diffuse * dc) * texture2D(tex01,gl_TexCoord[0].st) + gl_LightSource[0].specular * sc;
{
,{)}%A*
}fac:
5 fac~ P.
,{)}%A*
}fac:
5 fac~ P.
foxtrot uniform charlie kilo :)
#define Code of the future
InitDemo(make_all); // Inits the demo and everything
Playsound(random_chiptune); // Plays some cool tune
ChooseColorScheme(Dutch); // Psychedelic colors
AddPart(); // Adds a new part
MakePlasmaOnTheTop(); // Plasma on top
MakeScrollerOnTheMiddle(some_text); // Scroller on middle
MakeWolfensteinOnTheBottom(); // wolfentein on bottom
AddPart(); // another part
greets = WriteGreetings(cool_dudes); // greets those doods
MakeRotozoomerOnTheLeftSide(); // rotozoomers are leet
MakeFeedbackEffectWithText(greets); // feedback blur
AddPart(); // last part
MakeFullscreenVoxelWorld(); // the killer effect
RunDemo(); // it runs
InitDemo(make_all); // Inits the demo and everything
Playsound(random_chiptune); // Plays some cool tune
ChooseColorScheme(Dutch); // Psychedelic colors
AddPart(); // Adds a new part
MakePlasmaOnTheTop(); // Plasma on top
MakeScrollerOnTheMiddle(some_text); // Scroller on middle
MakeWolfensteinOnTheBottom(); // wolfentein on bottom
AddPart(); // another part
greets = WriteGreetings(cool_dudes); // greets those doods
MakeRotozoomerOnTheLeftSide(); // rotozoomers are leet
MakeFeedbackEffectWithText(greets); // feedback blur
AddPart(); // last part
MakeFullscreenVoxelWorld(); // the killer effect
RunDemo(); // it runs
..I forgot
#include <stdafx_demo.h>
#include <d3dx16.h>
#include <leet&easy.h>
#include <stdafx_demo.h>
#include <d3dx16.h>
#include <leet&easy.h>
bclr #8,LEVBIT-$8000(a2)