Post your code

Post your code.

Attached: scrot.png (1650x1008, 271K)

Other urls found in this thread:

0x0.st/zen2.txt
twitter.com/SFWRedditGifs

I would but I signed an NDA

Not
Doing
Anything

>(for file: String)
explain meaning of this

Attached: radix_sort.png (789x789, 88K)

shit code

>xmalloc
>not using malloc
?

here is some critial code section I wrote and have the rights to post it.

Attached: YHZSBQI[1].png (1285x834, 34K)

>[
it just wrapper that prints errno and aborts on out-of-memory
common unix habit

local SDL = require 'SDL'
local mspf = 1000/60
local rainbow = coroutine.wrap(function ()
local c = 0xff0000
while true do
while c < 0xffff00 do
coroutine.yield(c)
c = c + 0x000100
end
while c > 0x00ff00 do
coroutine.yield(c)
c = c - 0x010000
end
while c < 0x00ffff do
coroutine.yield(c)
c = c + 0x000001
end
while c > 0x0000ff do
coroutine.yield(c)
c = c - 0x000100
end
while c < 0xff00ff do
coroutine.yield(c)
c = c + 0x010000
end
while c > 0xff0000 do
coroutine.yield(c)
c = c - 0x000001
end
end
end)
local function sdltest()
SDL.init {SDL.flags.Video}
local w = SDL.createWindow {
title = 'rainbow',
width = 640,
height = 480
}
local r = SDL.createRenderer(w, -1,
SDL.rendererFlags.Accelerated)
local q = false
repeat
for _ = 1, 37 do rainbow() end
r:setDrawColor(rainbow())
r:clear()
r:present()
local t = SDL.getTicks()
while SDL.getTicks() - t < mspf do
for e in SDL.pollEvent() do
if e.type == SDL.event.Quit then
q = true
end
end
end
until q
SDL.quit()
end
sdltest()

Attached: image.png (1160x806, 139K)

Attached: pythonw_FRsZYQxprp.png (652x644, 15K)

Attached: carbon.png (1548x1238, 219K)

Couldn't you wrap all those whiles in a function like

local foo(value, inc) {
while c < value do
coroutine.yield(c)
c = c + inc
end
}


and then do

while true do
foo(0xffff00,0x000100)
foo(0x00ff00,0x010000)
foo(0x00ffff,0x000001)
...


don't know any Lua btw

Attached: 1560278201302.png (1515x663, 116K)

yeah definitely but i was too caught up in figuring out how to cycle the hue of a color at full saturation to bother

Attached: carbon.png (1498x2678, 514K)

I like your comments.

print(*['fizzbuzz' if i % 15 == 0 else 'buzz' if i % 5 == 0 else 'fizz' if i % 3 == 0 else i for i in range(1, 101)], sep='\n')
Could probably be made shorter

Where are the comments?

Attached: 1559750875342.gif (256x256, 352K)

for i in range(1,101):print("FizzBuzz"[i*i%3*4:8--i**4%5] or i)

up your ass

trash code

>he thinks there's comments or documentation in production

Attached: 1559822724230.jpg (400x399, 18K)

HL Local X/Y,DE Bounding Box
;C Shot side
;A Returns shot ID
TestShot:
ld (gensho),hl ;X/Y
ld (gensho+2),de ;Bounds
ld hl,$7400
ld (gensho+4),hl ;address boy
ld b,0 ;Actual sprite ID counter
Tshotl:
ld hl,(gensho+4)
ld a,(hl)
cp 0
jp z,SpReject ;Free slot
cp $ff
jp z,SpReject ;Reflected
and $80
cp c ;Not the right field
jp nz,SpReject

ld de,3
add hl,de ; Jump target-id/sprite and the low X
ld a,(gensho+1) ;X bounding box
ld d,a
ld a,(hl) ;X High shot
sbc a,d ;Distance from left bound (will overflow if distance smaller and it's a good thing)
ld d,a
ld a,(gensho+3) ;Bounding box size X
cp d ; subtract position from size, will carry if either the other sub overflowed, or if its too big
jp c,SpReject
inc hl
inc hl ;Go to High y
ld a,(gensho) ;Y bounding box
ld d,a
ld a,(hl) ;Y High shot
sbc a,d ; Same trick as above
ld d,a
ld a,(gensho+2) ;Bounding box size Y
cp d ; Same trick as above
jp nc,Tsfoundshot ;Save a few bytes
SpReject:
ld hl,(gensho+4)
ld de,10
add hl,de
ld (gensho+4),hl
inc b
ld a,(maxshot)
add a,10
cp l
jp nz,Tshotl
ld a,255 ;No shot id
ret
Tsfoundshot:
ld a,b
ret

trash coder

Use #define, you fucking negro.

6 struct cl_list_node {
7 struct cl_list_node *prev;
8 struct cl_list_node *next;
9
10 struct cl_obj *data;
11 };
12
13 struct cl_list {
14 struct cl_list_node *first;
15 struct cl_list_node *last;
16 };
17
18
19 //Internal static declarations
20 static void _destroy_list_node(struct cl_list_node *node);
21
22 //Public functions
23 //Return a new, empty CL List
24 CL_Obj *cl_new_list(void) {
25 struct cl_obj *ret;
26 struct cl_list *new_list;
27 new_list = calloc(1, sizeof(*new_list));
28 if (!new_list) {
29 return NULL;
30 }
31 ret = cl_new(CL_TYPE_LIST, new_list);
32 if (!ret) {
33 free(new_list);
34 }
35 return ret;
36 }
37
38 void cl_destroy_list(void *data) {
39 struct cl_list *list = data;
40 if (!list) {
41 return;
42 }
43 struct cl_list_node *cur = list->first, *next;
44 while (cur) {
45 //Save off next before destroy cur
46 next = cur->next;
47
48 _destroy_list_node(cur);
49 cur = next;
50 }

Attached: 1561033251796.jpg (946x707, 93K)

>t. jobless need

t. old man

Attached: code.png (910x956, 160K)

do you have a job, Evan?

why are we posting screenshots of our code? guess ill join in. just my shitty little code for uploading to 0x0.st. uploads the region if selected, the whole buffer otherwise, and if you call it with C-u you can select a file to upload.

0x0.st/zen2.txt

Attached: 2019-06-20-161900_886x714_scrot.png (886x714, 107K)

well done code is the best documentation

Nope, quit in March.

NEET!

self-documenting code

Well, I'm in school. But yes, the unemployed life has been good. :-)

why? you live off passive income now?

Saved up enough to last me a couple years while I complete a four year. I intend to get a passive income but I'm not holding me breath that anything will work out.

Basic rendering functions for JavaScript/HTML5 canvas, packaged as a class for ease of use.

Attached: js_drawing_code.png (1400x3300, 502K)

for(i=0;i++

>print('what is your name')
>#asks their name
based

def cobs_decode(input: String): String = {


val output = new util.ArrayList[Char]

var startFlag: Boolean = false
var endFlag: Boolean = false

for(a

no such a thing.

for you

i do not like ruby, and ilm is pissing me off

Attached: file.png (1118x506, 87K)

>all these non C++ posts
Just use C++ ffs

but there's C++ right here

you think any of these cs undergrad larpers write code for anyone but themselves?
in b4
>self documenting
>muh elegance
>muh high level language
>muh patterns
nope, you have to give pajeet a fighting chance or he will email you every 5 minutes about dumb shit.

>what is self documenting

For what, 256? you kidding me?

for (int i = 0; i < SH; i++) {
int x = sinf(tick+i)*tick+(SW/2-tick/20)+8+sinf(i*3)*8;
int y = cosf(tick+i)*tick+(SH/2-tick/20)+8+cosf(i*3)*8;
if (x >= 0 && y >= 0 && x < SW && y < SH) {
uint8_t d = clamp(0xFF-i);
screen->data[x+y*SW] = (d

Attached: thing.gif (510x510, 276K)

print "Hello, world!" #comment to please

why the fuck would you use semicolons at the end of the line in swift