Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-4041-

code challenge

Name: Anonymous 2014-01-07 1:39

Do something graphical in 50 lines of readable normally formatted code, don't count whitespace or lines with a single character(like a closing brace).

Name: Anonymous 2014-01-07 2:01

That ain't all that hard if you use OpenGL or something.

Name: Anonymous 2014-01-07 2:34

for(int i=1, i>0, i++} {
std::cout << "NO";
}

Name: Anonymous 2014-01-07 2:52

C

extern void ENTERPRICE_GUI_helloWorld (void);

void /* ENTERPRICE QUALITY */
main (void)
{
  ENTERPRICE_GUI_helloWorld ();
}

Name: Anonymous 2014-01-07 3:09

>>2

The challenge is making something cool, i'm gonna give a shot at this in a bit.

Name: Anonymous 2014-01-07 5:20

OnHellFrozen(){
  alert(" Ha! ");
  }

Name: Anonymous 2014-01-07 17:43


class Test {
    static function main() {
        var mc:flash.display.MovieClip = flash.Lib.current;
        mc.graphics.beginFill(0xFF0000);
        mc.graphics.moveTo(50,50);
        mc.graphics.lineTo(100,50);
        mc.graphics.lineTo(100,100);
        mc.graphics.lineTo(50,100);
        mc.graphics.endFill();
    }   
}

What do I win?

Name: Anonymous 2014-01-07 19:40

repeat 4 [repeat 2 [fd 50 rt 90] fd 25 rt 90 repeat 2 [fd 25 lt 90]]

Name: Anonymous 2014-01-08 0:59

`shutdown -Ph -t 0 "now"`

Name: Cudder !MhMRSATORI!fR8duoqGZdD/iE5 2014-01-08 2:06

something graphical
* = $7c
ora $a2
and #$3f
tay
sbc $a1
eor $a2
ora $a2
and #$7f
sta $d400,y
sta $cfd7,y
bvc $7c


If you really want 50 lines just nop the rest...

Name: Anonymous 2014-01-08 4:45

Better challenge:

Something running on (not through!) the GPU (I don't care if it's NVIDIA, AMD, ARM, Intel etc.), on your VMS, DOS or UNIX hybrid franken OS of choice (Windows, Linux or OSX all count), without utilizing your graphics driver (i.e. write a minimal one) in 50 lines or less.

Name: Anonymous 2014-01-08 4:51

Better challenge:

Solve the halting problem in 50 lines or less.

Name: Anonymous 2014-01-08 7:18

>>10
Shalom!

Name: Anonymous 2014-01-08 16:46

[code]require "qt"
require "singleton"
class MainWindow < Qt::Widget
  include Singleton
  def initialize
    super
    resize 640, 480
  end
end

app = Qt::Application.new ARGV
MainWindow.instance.show
app.exec

Name: Anonymous 2014-01-08 16:47

>>14

Fuck I forgot my closing tag. Now it just looks ugly.

Name: Anonymous 2014-01-08 19:21

>>15
this is how to check if you are from /g/ ^^
I like e/g/in boys ^^

Name: Anonymous 2014-01-09 4:25


#!fioc2

string = raw_input()
parts = []
end = []

for c in string:
    parts.append('[sup]')
    parts.append(c)
    end.append('[/sup]')

print ''.join(parts) + ''.join(end)


XXXXXXXX

Name: Anonymous 2014-01-09 6:52

>>15
It's Ruby _and_ Qt. It'll look ugly anyway.

Name: Deavmi 2014-01-09 12:47

import tkinter
def poop():
    print("POOP")
    print("POOP")
    print("POOP")
    print("POOP")
    print("POOP")
    print("POOP")
app_name = "ShitBox"
shitbox.Tk()
shitbox.title(app_name)
shittext = Label.Tk(text="SHITZ BRICKZ." command="poop")

Name: Anonymous 2014-01-09 13:09

JFrame f = new JFrame("/prog/");
f.setVisible(true);

Name: Anonymous 2014-01-09 16:12


#include <stdio.h>

int main()
{
   int i;
   for(i = 0; i < 10; i++)
      printf("I AM DEAVMI" "\n");
   return 0;
}

Name: Anonymous 2014-01-09 16:13

dubs challenge
check em

Name: Anonymous 2014-01-09 20:43

Check it /prog/. It just uses SDL and SDL_gfx. I have a version where it uses LodePNG to load an image to the cursor, but then I can't add AG_HSV2RGB in the file with 50 lines, and need to link with the library it comes from (Agar).

Windoze:
%gcc% main.c -lmingw32 -lSDLmain -lSDL -lSDL_gfx -lwinmm

Even normally formatted it is 50 lines:


#include <SDL/SDL.h>
#include <SDL/SDL_gfx.h>
#include "lodepng.h"
SDL_Surface* video = NULL;

void AG_HSV2RGB(float h, float s, float v, Uint8 *r, Uint8 *g, Uint8 *b) {
    float var[3];
    float vR, vG, vB, hv; int iv;
    hv = h/60.0F;
    iv = floor(hv);
    var[0] = v * (1.0F - s);
    var[1] = v * (1.0F - s*(hv - iv));
    var[2] = v * (1.0F - s*(1.0F - (hv - iv)));
    switch (iv) {
    case 0:        vR = v;        vG = var[2];    vB = var[0];    break;
    case 1:        vR = var[1];    vG = v;        vB = var[0];    break;
    case 2:        vR = var[0];    vG = v;        vB = var[2];    break;
    case 3:        vR = var[0];    vG = var[1];    vB = v;        break;
    case 4:        vR = var[2];    vG = var[0];    vB = v;        break;
    default:    vR = v;        vG = var[0];    vB = var[1];    break;}
    *r = vR*255; *g = vG*255; *b = vB*255;
}
int RenderScene(void) {
    SDL_Event MEvent;
    Uint8 r, g, b;
    int mx, my;
    char text[32];
   
    while(SDL_PollEvent(&MEvent)) {    if(MEvent.type == SDL_QUIT)  return 1; }
   
    memset(video->pixels, 0x11111111, 640*480*4);
    SDL_GetMouseState(&mx, &my);
   
    sprintf(text, "[%03d %03d]", mx, my);
    AG_HSV2RGB(((float)my / (float)480)*360, 1, 1, &r, &g, &b);
    stringRGBA(video, mx-35, my-10, text, r, g, b, 255);
   
    SDL_UpdateRect(video, 0, 0, 0, 0);

    return 0;
}
int main(int argc, char** argv)  {
    if(SDL_Init(SDL_INIT_VIDEO) != 0) return 1;
   
    video = SDL_SetVideoMode(640, 480, 32, SDL_SWSURFACE|SDL_HWACCEL);
    SDL_WM_SetCaption("/prog/ Challenge", NULL);

    while(1) { SDL_Delay(1); if(RenderScene()) break; }
    SDL_Quit(); return 0;
}

Name: Anonymous 2014-01-09 20:45

Also remove the #include "lodepng.h".

Name: Anonymous 2014-01-09 22:17

>>24
>le pedophile sage

Name: L. A. Calculus !!wKyoNUUHDOmjW7I 2014-01-09 23:24

>>23
ITZ ONE THING TO NOT REED DA FUKIN STANDARD, BUT U AINT EVEN RED DA FUKIN DOCUMENTATION FOR SDL.

GODDAM STAK BOIZ

Name: Anonymous 2014-01-10 1:15

>>24
>le pedophile sage

Name: Anonymous 2014-01-10 14:38

>>23

on my system, had to change SDL_gfx.h to SDL_gfxPrimitives.h, remove lodepng, and compile with: gcc -I/usr/include/SDL sdl_test.c -lSDL -lSDL_gfx

Name: Anonymous 2014-01-10 16:08


import quake3

Name: Anonymous 2014-01-10 16:24

>>29

This is very similar to what everyone here is doing, only this makes it obvious.

None of you are writing anything in less than 50 lines of code. You're writing something in less than 50 lines of your own code while using 100s if not 1000s of lines of someone elses.

I posted a simple ammended challenge, but no one has yet answered it. I can only conclude that either
1. Today's computers are fundamentally retarded and access to parts of it are very very very hard.
2. Today's programmers are not very good.

Name: Anonymous 2014-01-10 17:14

>>30
Cudder did in >>10.

Name: Anonymous 2014-01-10 17:54

>>33
nice dubs

Name: Anonymous 2014-01-10 18:04

>>31

No he didn't.

Name: Anonymous 2014-01-10 18:56

>>30

I'm not sure what you're getting at here, because code always builds on top of a pre-existing system.  Besides another layer of abstraction, what's the difference between making use of a library in C code, or calling interrupts in assembly.  You still at minimum make use of OS code and the hardware drivers.

Name: Anonymous 2014-01-10 19:30

>>34

It's pathetic that you have to use a driver to access the GPU. Imagine if you had to use a driver to access the FPU.

Name: Anonymous 2014-01-10 19:52

>>35
It's because NVidia and ATI keep the interfaces secret so Linux can't have better drivers than Windows. Imagine if Linux developers made a driver that got twice the performance of the Windows drivers on the same hardware. Gamers would be demanding games for Linux.

Name: Anonymous 2014-01-10 22:59

>>36

Yes the graphics hardware companies are in a conspiracy to keep linux down. Sure.

Or maybe the endless of variations on gpu hardware a computer has requires a layer of abstraction so code consistently works across all the hardware.  Exposing hardware more directly would definitely have performance benefit for games, like it does on consoles, but not really that much, because how many games can afford to hand optimize for 40 different graphics cards every release.

The biggest performance gain for consoles is not that the hardware is more exposed, but that it's consistent, which makes it much easier to tune and optimize for.

Name: Anonymous 2014-01-10 23:03

>>37
Yes the graphics hardware companies are in a conspiracy to keep linux down. Sure.
They are, through bloated buggy binary blob drivers.

Name: Anonymous 2014-01-10 23:25

>>38
nvidia

Name: Anonymous 2014-01-11 8:01

Drivers are always a cornerstone of the Operating System.
Its like engines in a car. You can push the car but it won't be useful for much of the tasks.

Name: Cudder !MhMRSATORI!fR8duoqGZdD/iE5 2014-01-11 9:20

>>33
Then what's the "100s if not 1000s of lines of someone elses"? Besides, you got my gender wrong. That's worth -1 already.

1. Today's computers are fundamentally retarded and access to parts of it are very very very hard.
This. Abstraction is overrated anyway.

Name: Anonymous 2014-01-11 10:50

>>40
Mind blown.

Name: Anonymous 2014-01-11 14:47

>>40,41
BIOS and EFI can boot from USB and Ethernet so it obviously has drivers for those devices, but you can't use them in your OS! BIOS has all these features but they only work in 16-bit mode so the OS has to reimplement everything. EFI forces you to use FAT partitions and EXEs to do what BIOS could do in 512 bytes.

Name: Anonymous 2014-01-11 16:41

>>41

I don't give a shit about your gender. If you have a vagina though I'm more interested.

Name: Anonymous 2014-01-11 21:16

>>44
"She" is trans.

Name: Anonymous 2014-01-11 21:31

>>45

I figured.

Name: Anonymous 2014-01-11 21:57

  .      .      *           .       .          .                       .
                 .       .   . *            "Go where you will...
  .       ____     .      . .            .    I'll always love you, Cudder."
         <WW>>>         .        .               .
 .   .  /WWWI; \  .       .    .  ____               .         .     .        
  *    /WWWWII; \=====;    .     /WI; \   *    .        /\_             .
  .   /WWWWWII;..      \_  . ___/WI;:. \     .        _/M; \    .   .         .
     /WWWWWIIIIi;..      \__/WWWIIII:.. \____ .   .  /MMI:  \   * .
 . _/WWWWWIIIi;;;:...:   ;\WWWWWWIIIII;.     \     /MMWII;   \    .  .     .
  /WWWWWIWIiii;;;.:.. :   ;\WWWWWIII;;;::     \___/MMWIIII;   \              .
 /WWWWWIIIIiii;;::.... :   ;|WWWWWWII;;::.:      :;IMWIIIII;:   \___     *
/WWWWWWWWWIIIIIWIIii;;::;..;\WWWWWWIII;;;:::...    ;IMIII;;     ::  \     .
WWWWWWWWWIIIIIIIIIii;;::.;..;\WWWWWWWWIIIII;;..  :;IMIII;:::     :    \  
WWWWWWWWWWWWWIIIIIIii;;::..;..;\WWWWWWWWIIII;::; :::::::::.....::       \
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%XXXXXXX

Name: Cudder !MhMRSATORI!fR8duoqGZdD/iE5 2014-01-12 2:42

>>43
That was not even code for a PC.

Name: Anonymous 2014-01-12 23:17

Name: Anonymous 2014-01-15 5:15

beemp

Don't change these.
Name: Email:
Entire Thread Thread List