[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 / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
/dpt/ - Daily Programming Thread
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

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

Thread replies: 14
Thread images: 2
File: 1449004396304.jpg (259 KB, 800x1156) Image search: [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?
>>
File: agdg in a nutshell.png (64 KB, 914x800) Image search: [Google]
agdg in a nutshell.png
64 KB, 914x800
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

banner
banner
[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 / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [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.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.