pouët.net

Go to bottom

Random line of code thread

category: code [glöplog]
Quote:
Ok, first post on pouet.net

Code:return mix(hsv2rgb(vec3(floor(p.x+time*SPEED)/(8.), 1., 1.))*(1.-smoothstep(.01, 0., 1. -mod(p.x+time*SPEED, 1.))), vec3(step(0.,cos(p.y*(20.*p.x)))), smoothstep( mod(p.x+time*SPEED, 1.), mod(p.x+time*SPEED, 1.) +.025, abs(p.y)));

(yup, I did it wih my hands)

Used it here (splitted in the getColor part) :
http://glslsandbox.com/e#23197.0
added on the 2015-02-23 20:18:51 by kloumpt kloumpt
Code: void sendAvatarToYperperan(int avatarId) { avatar[avatarId]->setPosition(osg::Vec3f(10000.0f, 10000.0f, 10000.0f)); // should make the visibilitySwitch work in the future }


Still makes me laugh.
added on the 2015-03-11 12:12:47 by Optimus Optimus
Code:rol al,cl
Code:var %y $calc(($sin($calc((128 * ($cos(%c).deg * 7.2)) + (%cnt * %dist))).deg * (60 + (%dm.chessboard.bobs.rad / 2))) + (90 + 2))
added on the 2015-03-11 15:09:10 by ___ ___
Code:aam
Code:shl byte[gs:di],2
Code:nop ;256
Code:extern "C" __declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
added on the 2015-04-29 08:52:50 by EvilOne EvilOne
Code: move.w #$1fe,6+8(a0,d0.w) ; kill bitplanes
added on the 2015-05-01 20:25:16 by StingRay StingRay
Code:RecursiveFor(0);
added on the 2015-05-02 15:30:29 by baah baah
Code:return 0 if defined( $stiValue ) && $stiValue ne $token->data;
Code:lsr.l #1,d0 ; kill right side -> no gap in the middle
added on the 2015-05-08 08:27:16 by StingRay StingRay
Code:DC.B 'FUNNY CODE EH? EASY TO STEAL? '


Code:DC.B 'PLEASE REMEMBER US IN YOUR RIP!!'



From The 100 most remembered c64 game tunes which has some nicely protected code (some prefetch "magic" is exploited to disguise what the actual code is doing). Not too surprising if you know who the coders are. :)
added on the 2015-05-19 10:56:50 by StingRay StingRay
Code:drawDisplayBufferFast di ld bc,PAGE1 ;!!!! ld a,Tile_page out (c),a ; 40 x32 exx ld hl,displayBuffer+4*displayBufferWidth+4 ld de,displayBuffer+4*displayBufferWidth+4+(displayBufferWidth*displayBufferHeight) ld bc,#4080 ; PAGE1 exx ld c,240/8-1 dDBF2 exx ld ixl,4 dDBF1 dup 10 ...
added on the 2015-05-19 13:12:28 by VBI VBI
Code:#define GLSL(src) "#version 330 core\n" #src


Newlines are ignored... beware (:
added on the 2015-05-22 14:09:58 by EvilOne EvilOne
Code: class Tsipras : public democore::Scene { public: Tsipras() {}; ~Tsipras() {}; void init(); void update(); void draw(); void release(); private: void setCam(); std::vector<class Merkel*> m_merkels; glm::vec3 m_cameraPosition; glm::vec3 m_cameraTarget; glm::vec3 m_cameraUp; };
added on the 2015-07-07 01:19:08 by Preacher Preacher
I was reading about different indent styles and someone pointed me into this:

Code: /********************************************** This class represents an environment in the environment simulation of Assignment 4, CS 152, Spring 2000. In this assignment the environment is a run-time object in a statically scoped, compiled language, so variables are represented as pairs of offsets. The environment is represented as a Java Stack of Frames. A display is used to avoid linear searches for the appropriate frame at run time. This is the only Environment state variable. The only Environment constructor returns an empty environment; it has no arguments. There are other methods addFrame (that adds a frame given the frame), deleteFrame (that deletes the top frame and takes no argument), lookup (that looks up the value of a variable given two integer offsets), and lookupAndPrint (that prints the value of a variable given two integer offsets, and issues a newline). If the lookup function fails, it raises a OffsetOutOfBoundsException. The lookupAndPrint method prints a simple error message in this case. A display represents the chain of frames accessible from the current frame by following static links. There is a private class Display that represents the display. When a frame is added to or deleted from the environment, the display is recreated from scratch. The Display constructor is responsible for doing this; its sole argument represents the current frame. The only other Display method returns the appropriate frame given the first offset in a pair of offsets (i.e., given an integer). **********************************************/ import java.io.*; import java.util.*; class Environment extends Stack { // This is an exception class for failure // of lookup within the environment private class OffsetOutOfBoundsException extends IOException { public OffsetOutOfBoundsException() {} } private class Display extends Vector { // This constructor recreates the display // beginning at frame f. Note that if // f is null, the display will be empty. public Display(Frame f) { super(5); while (f!=null) { addElement(f); f=f.getStaticLink(); } } // This selector returns the ith frame public Frame getFrame(int i) throws ArrayIndexOutOfBoundsException { return (Frame) elementAt(i);} } // begin Environment // the only state variable private Display display; // This constructor builds an empty // environment. It initializes the // display to be empty. public Environment() { super(); display = new Display(null); } // This method adds the frame f to the // environment by pushing it onto // the stack of frames. It also // recreates the display beginning // at the new top frame f. public void addFrame(Frame f) { addElement(f); display=new Display(f); } // This method deletes the current frame // from the environment by popping it // from the stack of frames. It recreates // the display starting at the new top // frame, if there is one. Otherwise it // creates an empty display by calling the // Display constructor with a null argument. public void deleteFrame() { pop(); if (empty()) display = new Display(null); else display = new Display((Frame) lastElement()); } // This method returns the value of a variable // represented as the offset pair (i,j). // Since a display is used, it need only // get the ith frame from the display and // get the filler of the jth binding of // that frame. // It raises a OffsetOutOfBoundsException if // the lookup for either element of the pair // fails. private FillerClass lookup(int i, int j) throws OffsetOutOfBoundsException { try { Frame f=display.getFrame(i); return f.lookup(j).getFiller(); } catch(ArrayIndexOutOfBoundsException e) { throw new OffsetOutOfBoundsException();} } // This method prints the value of a variable // represented as the offset pair (i,j) by // invoking the Environment lookup method. public void lookupAndPrint(int i, int j) { try { System.out.print(" "); FillerClass fc=lookup(i,j); fc.print(); } catch(OffsetOutOfBoundsException e) { System.out.print(" out of bounds");} } }
added on the 2015-07-17 14:25:34 by Optimus Optimus
Code: if (%gj.effect.flip_Vertical == 1) { drawcopy -nsc @gifJockey.out 0 0 %gj.win.outW %gj.win.outH @gifJockey.out %gj.win.outW 0 $+(-,%gj.win.outW) %gj.win.outH }
added on the 2015-07-20 14:41:13 by ___ ___
Code:.GRF .DBR *vbg_z_y/*vbg_z_x *vbg_z_h-/*vbg_z_b RE
added on the 2015-07-20 16:42:26 by uncle_H uncle_H
Code:cmp.l #"TURD",d4
added on the 2015-07-20 23:40:51 by StingRay StingRay
&a a9? 9[ae a? a][au@. (MS 408, ASCII)
Code:return mix(max(pyr(r*ry(time*.13),1.5+2*b6),-pyr(vec3(r.x,-r.y+.4,r.z)*ry(time*.13)*rx((time-260)*.24*a8)*rz((time-260)*.23*a8),1.5*(1-b3)*(1-b6)+3*a8)),min(min(min(sp(r+a1*vec3(0,.4883,0),.6),sp(r+a1*vec3(-.3554,-.4883,-.6),.6)),sp(r+a1*vec3(.6838,-.4883,0),.6)),sp(r+a1*vec3(-.3554,-.4883,.6),.6)),b2-(1-b3));
added on the 2015-07-31 12:39:18 by noby noby
BB Image
added on the 2015-08-11 12:44:13 by kb_ kb_
kb_: That almost has Wing Commander qualities!
BB Image
Code:cmp bp,32222

login

Go to top