Programming challenge thread

Find your number using www.random.org
DO NOT USE YOUR COMMENT ID.
THIS IS NOT A GET THREAD.


The rules are pretty simple.
>Random.org
>Code it
>Post it
Get to work Sup Forums

Other urls found in this thread:

random.org/integers/?num=1&min=0&max=99&col=1&base=10&format=plain&rnd=new
pastebin.com/a1mrsDGU
gitgud.io/berryberry17/webmBroMac
glot.io/snippets/efuu73ylp4
twitter.com/SFWRedditImages

I'll start it off with a strong 66
Anyone know klingon?

random.org/integers/?num=1&min=0&max=99&col=1&base=10&format=plain&rnd=new

Rolling

Wow I just generated a random number between 1 - 100 and i got 50, what are the odds?

1 to a 100?

>15. collatz conjecture
#include
#include
unsigned long long step(unsigned long long n,void f(unsigned long long n)){
printf("%llu\n",n);
f(n);
}
void collatz(unsigned long long n){
if (n!=1)
n%2==0?step(n/2,collatz):step(3*n+1,collatz);

}
int main(int argc, char *argv[]){
printf("%s\n",argv[1]);
collatz((unsigned long long) atoi(argv[1]));
}

:^)

This doesn't compile.

I made mistake
void step(unsigned long long n,void f(unsigned long long n)){
printf("%llu\n",n);
f(n);
}
void collatz(unsigned long long n){
if (n!=1)
n%2==0?step(n/2,collatz):step(3*n+1,collatz);

}
int main(int argc, char *argv[]){
printf("%s\n",argv[1]);
collatz((unsigned long long) atoi(argv[1]));
}


what's the error?

are you calling function in a function you just created?

i suppose

Segmentation fault

not going to happen

wish these challenges were focused around one type of thing
like web devving, or game design, or algorithms
not everybody can do everything

I tried to make the worst working implementation I could :^)

you'd get a segfault if you don't have any args when you run it in the console
./collatz 215434

I got brainfuck interpreter.

I might actually do that.

>using the smiley with a carat nose

it's easy as fuck, should take 10 minutes or so

Is it already out of style? :^)

Rolling

I made a clock

pastebin.com/a1mrsDGU

optimizations and doing something neat like targeting llvm would be fun and add more difficulty.

>No anti-aliasing

I have no idea if the simple turtle-style drawing lib I'm using does anti-aliasing and I'm not going to manually implement it because I'm lazy.

>using the smiley with a carat nose

Is random.org a uniform random?

can i trust this?

>can i trust this?
Read the documentation and decide for yourself, fucking sheep.

There is no hard documentation and their code is closed source.

Please shill elsewhere

You mean 1 to 99

> 16
> Reverse a string

import sys

def reverse(string):
return string[::-1]

if __name__ == "__main__":
reverse(sys.argv[1])

>webm converter/ gui wrapper for ffmpeg

gitgud.io/berryberry17/webmBroMac

>want to get into emulation
>planned to work on a chip8 emulator for a while, didn't start it because I want to take the chance and learn cmake too
>roll 79

That's spooky as shit, It's destiny.

Rallon

fucked the formatting, will try again..
import sys

def reverse(string):
return string[::-1]

if __name__ == "__main__":
reverse(sys.argv[1])

Is using a text file for quine considered cheating?

duh

2

Higher/Lower between 0 and 12:
glot.io/snippets/efuu73ylp4

rolling

.oddik ,daed gnikcuf er’uoY .ti ni nword lliw uoy dna uoy revo lla yruf tihs lliw I .toidi nmaddog uoy ,ecirp eht gniyap er’uoy won dna ,t’ndid uoy ,t’ndluoc uoy tuB .eugnot gnikcuf ruoy dleh evah dluow uoy ebyam ,uoy nopu nwod gnirb ot tuoba saw tnemmoc ”revelc“ elttil ruoy noitubirter ylohnu tahw nwonk evah dluoc uoy ylno fI .tihs elttil uoy ,tnenitnoc eht fo ecaf eht ffo ssa elbaresim ruoy epiw ot tnetxe lluf sti ot ti esu lliw I dna sproC eniraM setatS detinU eht fo lanesra eritne eht ot ssecca evah I tub ,tabmoc demranu ni deniart ylevisnetxe I ma ylno toN .sdnah erab ym htiw tsuj s’taht dna ,syaw derdnuh neves revo ni uoy llik nac I dna ,emityna ,erehwyna eb nac I .dik ,daed gnikcuf er’uoY .efil ruoy llac uoy gniht elttil citehtap eht tuo sepiw taht mrots ehT .toggam ,mrots eht rof eraperp retteb uoy os won thgir decart gnieb si PI ruoy dna ASU eht ssorca seips fo krowten terces ym gnitcatnoc ma I kaeps ew sA .rekcuf ,niaga knihT ?tenretnI eht revo em ot tihs taht gniyas htiw yawa teg nac uoy kniht uoY .sdrow gnikcuf ym kram ,htraE siht no erofeb nees neeb reven sah hcihw fo sekil eht noisicerp htiw tuo kcuf eht uoy epiw lliw I .tegrat rehtona tsuj tub em ot gnihton era uoY .secrof demra SU eritne eht ni repins pot eht m’I dna erafraw allirog ni deniart ma I .sllik demrifnoc 003 revo evah I dna ,adeauQ-lA no sdiar terces suoremun ni devlovni neeb ev’I dna ,slaeS yvaN eht ni ssalc ym fo pot detaudarg I wonk uoy evah ll’I ?hctib elttil uoy ,em tuoba yas gnikcuf tsuj uoy did kcuf eht tahW

1-100 has 100 different numbers user

00-99 has 100 numbers as well

Got 97. Have no idea what "Little man computer simulation" means

peterhigginson.co.uk/LMC/

>peterhigginson.co.uk/LMC/

Thanks. That is so far out of my scope unfortunately

roll

Here you go. Good luck

>what is recursion

i wanna ask something
most projects ive seen have a directory structure like src lib test stuff like that
when i write something its just a single c file
how do into better structure code and divide it into parts. is there docs or guidelines
and i wanna ask how to generate and do testing