[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vip /vp / vr / w / wg / wsg / wsr / x / y ] [Search | Home]
4Archive logo
/dpt/ - Daily Programming Thread
If images are not shown try to refresh the page. If you like this website, please disable any AdBlock software!

You are currently reading a thread in /g/ - Technology

Thread replies: 14
Thread images: 2
File: 1449004396304.jpg (259 KB, 800x1156) Image search: [iqdb] [SauceNao] [Google]
1449004396304.jpg
259 KB, 800x1156
old thread: >>52518289

What are you working on, /g/?
>>
>>52523249
So I hardcoded a function in my interpreter
DEFS["foo"] = definition(["a", "b", "*"], ["a", "b"]);


and somehow the fucker works
$ ./maths
>eval foo(1,2)
= 2
>eval foo(2,7)
= 14
>end


fucking magnificent
it should already be possible to define recursive functions, except that I haven't implemented conditionals so it would have to be recursive forever

but god when shit like this actually works it's like coke
>>
>>52523249
So cute, is it a boy's love manga?
>>
Friendly reminder that programming is not exclusive to computers and anyone that argues otherwise is an uneducated code monkey who probably doesn't even write their own algorithms.
>>
>>52523264
another
DEFS["bar"] = definition(["a", "b", "foo", "c", "+"], ["a", "b", "c"]);


$ ./maths
>eval bar(1,2,3)
= 5
>eval bar(3,7,50)
= 71


functions in an expression are resolved and evaluated recursively
It's beautiful
>>
>>52523300
>thinking anyone cares about this
>>
Codeeval is progressively getting worse with every update.
First they made their test environment read-only so I couldn't fuck with the input file before running the program, then they made their environment so fragile, any tiny transgression like reading 1 byte outside of an allocated char array is cause for segfault.
Now their scoring system is claiming my programs take over 20 seconds to run and refusing to score me.
>>
>>52523399
>any tiny transgression like reading 1 byte outside of an allocated char array is cause for segfault.
Are you honestly justifying reading data outside of allocated data? The fucking website should log you out for being this fucking bad.
>Now their scoring system is claiming my programs take over 20 seconds to run and refusing to score me.
Maybe your programs shouldn't be this fucking slow then.
>>
>>52523399
Learn to code filthy code monkey.
>>
>>52523399
>tiny transgression
>reading outside of allocated area
senpai how'd you get this retarded eh?
>>
>>52523399
sadly i don't think this is bait
>>
>>52523322
There's some old military videos that explain how battle ship computers worked. It's an interesting subject.
>>
>>52523911
they're still called computers to be fair, although they're mechanical rather than digital.

https://www.youtube.com/watch?v=s1i-dnAH9Y4
>>
>>52523911
>hurr analog computers aren't computors
Thread replies: 14
Thread images: 2
Thread DB ID: 448398



[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vip /vp / vr / w / wg / wsg / wsr / x / y] [Search | Home]

[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vip /vp / vr / w / wg / wsg / wsr / x / y] [Search | Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the shown content originated from that site. This means that 4Archive shows their content, archived. If you need information for a Poster - contact them.
If a post contains personal/copyrighted/illegal content, then use the post's [Report] link! If a post is not removed within 24h contact me at [email protected] with the post's information.