Programming challenges go

Programming challenges go

Other urls found in this thread:

projecteuler.net/
aisb.org.uk/events/loebner-prize#finals2017
citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.94.1737&rep=rep1&type=pdf
cryptopals.com/
github.com/pdimitratos/ProjectEuler/tree/master/ProjectEulerSolutions/ProjectEulerSolutions/Problems
twitter.com/NSFWRedditGif

projecteuler.net/

roll

rolling

reroll

reroll

llor

>tfw only made it to #4
and I spent a week on #3
i need to seriously pick this back up.

orllllll

I made it to 25. It was tough for me. I usually know what I need to do when I write a program so I don't bother writing stuff out with pen and paper. But I couldn't do it with these problems. I would spend hours in some cases just trying to understand the problem. Once I understood the problem writing the program was simple...until I ran the program and it took longer than a minute to run. Then I had to figure out how to speed up the calculation. Shit drove me crazy.

>and I spent a week on #3
Yeah, that was a pain in the ass. My answer was working for "smaller" numbers (billion) but it took over 6 minutes...the actual number we were supposed to factor would have taken hours (maybe days).

I didn't try to speed it up at first. I moved on to other problems. But then I kept banging my head against the "finding the multiples of" or "find the prime number" issues. I finally focused on making my solutions run faster. When I went back and took a second look at problem #3, I was able to get the answer in under a second. It was still slow compared to the people in the forums.

So now I'm working problems on reddit in my spare time. I knocked out the first 25 "easy" problems. And now I'm on #7 "intermediate". If I every make it past 25 on "hard" I'll circle back to the misery that is projectEuler.

If you pick it back up then good luck. It sucks but its good too.

Roll

roll...
Ye, why not?

>bootloader hard
>chatbot easy

the person who did this list is a fucking brainlet.

With python you can make a chat bot with 1 or 2 commands in 5-10 minutes.

Bootloader is going to be a little more time consuming unless you want to copy paste someone elses code.

Do you think getting to real mode in x86 is harder than importing a python module for irc?

>1 or 2 commands
What the fuck is a command in context to Python?

>Do you think getting to real mode in x86
do you even know what the fuck are you talking about?, computer starts on Real mode, if you mean switching to protected mode its fairly simple its a fucking lab on CS operating systems course.

A large domain chatbot is non deterministic problem and still an open problem in CS to solve involving things like recurrent neural networks.

>With python you can make a chat bot with 1 or 2 commands in 5-10 minutes

aisb.org.uk/events/loebner-prize#finals2017

can you explain me why fucking mitsuku (an AIML chatbot) is still in the first position?

You're right. I made a mistake.

The difficulty rating is completely subjective. There's a lot of stuff on that list that isn't ranked hard but I know I'd struggle with. Dealing with Lambert and Kepler is easy undergrad level, closer to yellow.
How about an n-body problem propagator that's accurate (doesn't lose energy due to numerical error) and relatively fast or, an ephemeris generator for a continuous n-DOF vehicle in LEO approached as a 3-body problem with atmospheric drag, solar flux and an inconsistent gravity field would be a lot more challenging and interesting and deserving a fuck you rating.
t. literal rocket scientist

Add it and make v5

how would you rate a prolog?

i'm not even sure I used a sieve, i think the first time i did it I just iterated through the numbers backwards until I eventually found it. which took forever to process.

I'm going to see if i can't implement the sieve of sorenson this time. looks interesting anyway and I want to put it to use for my bungfolio

citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.94.1737&rep=rep1&type=pdf

rollan

>C Compiler in same tier as Monster Breeding Game

lol

Anyone play TIS-100? If you want hard assembly-style programming challenges I can recommend it. I'm about 3/4 through. It's tough but not impossible.

Shenzhen IO is more funner

looks pretty neat actually

Do you need to develop your math knowledge a lot in order to be an efficient or good programmer?

It's been ages since I did math last.. So now I can only do basic equations.

yes user.

Here, right now find the sum of the given number of stars for the nth row:
*
**
***
****
*****
******

if n is 3, the sum will be 6, if n is 2, 3, etc.
You can use recursion or loop, but i challenge you to solve it in constant time for n where n is >= 1000000

You can do a lot of programming with algebra level knowledge. If you want to get into anything that some people on this site would consider programming then you would want to have a strong background in math.

Can't you just return n*(n+1)/2

you the same user?

nope

ro11ing

re

>math knowledge a lot in order to be an efficient or good programmer

To be an efficient programmer, absolutely.
To be a good programmer, less so but it helps.

it's the most fundamental part. logic=algorithms=math

but you don't need to have any real math skills to learn a language and make programs. many people can make programs without doing much work on algorithms (google the answer). but if you want to make the big bucks, you focus on algorithms. everything else follows from that.

then delet dis.
The point was to let user learn the value of mathematics by first struggling and then giving up, only to be saved by the holy light of that simplification. I discovered that when i delved into programming math became useful and interesting because i started to see parrallels between algorithms and formulas.

Oh, the game that was written after the dude gobbled up all of the regurgitated propaganda put out by an Chinese ethno-nationalist supremacist (Andrew Huang).

(n * (n+1))/2

Role

you copy-pasted that didn't you?
Either way math is a powerful tool, espceically in the hands of an SE

roll

Should be noted that maths looks a lot more tricky when written in mathematical notation. For example pic related is the same as.

res = 0;
for i in range(1, 101):
res += pow(3 - 2 * i, 2);
return res;


Granted not the most complicated example, but you can see how if you added more loops and operations it would quickly become a mindfuck when expressed mathematically.

roll

Roll

roll

rolling

What kind of brainlet are you?
Expand the binomial, generalize the formula for all n's, and simplify.
BOOM, constant-time calculations.

Need something harder
Rerole

go

God fuck, I've been programming on c++ for 8 years now and I can't do more than 5 of the green ones alone.
How the fuck do I get good?

roleing

roll

(3-2i)^2 = 9 - 6i - 6i + 4i^2
(3-2i)^2 = 9 - 12i + 4i^2
which can be further simplified by expanding 4i^2 into something the computer can understand:
(3-2i)^2 = 9 - 12i + (4i * 4i)

Now considering the simplification of the finite sequence as shown in .

I don't know how to do this part so thats up to you, but in essence the trick really is just to know that all math algorythms can ultimately be expressed in 1 generalized non-sequential formula, thus removing the need for loops and providing constant-time solutions.

practice

youre a fucking retard

roll

Practice what? Where do I even begin? I can do codingame challenges but that's about it.
How do I find validation for my code, that it is not complete garbage? How do I know I'm good enough to take part in open source projects?

how so?

>4i^2 == (4i * 4i)

>Practice what?
in essence the challenge is really to remove yourself from simple and repetitive tasks and really challenge yourself each day by tackling a novel problem you never have before. You will rarely encounter such issues in the gayming industry.

You simply gotta take whatever you roll on, and try to find solutions, if you look things up NEVER look up the solution, only lookup things you are uclear on. For example, lets say you're iterating through an array with a ahndler (a pointer poited to by a pointer) and you want to use it to reorganize the array. If you don't know anything about pointers you look that up. In essence you break down what you don't know into simple questions that never give you the solution to your problem, and then you tackle the problem itself on your own with the only help being this loosely-connected information.

Another thing, always go to coder sites (lke Sup Forums or other) to see how people who are better than you do it, ask them why they did it that way, really dissect their solution until you understand it.

And to keep your code great, always look for the lowest complexity, lowest memory, solution. The less lines the better. And always refactor. Never leave the code as it like pajeet, always find faster, simpler, more elegant solutions to a problem, if you can try and tackle a simple problem from different angles to gain some perspective on it.

this one is easy, but see if you can refactor this code to be more concise and elegant:
for(long i = 100; i >= 0; i = i-2){
if(i == 1){
return i;
}else if(i == 2){
return i+2;
}else if(i == 3){
return i+2;
}else{
return i;
}

fuck i just realized.
It is 1 in the morning so i'm willing to forgive myself but still.

Its 4(i*i) right? been a while since i did binomial expansion too...

8 fucking years and you can't even do 5 of the green ones alone?
Dude...
1, 5, 12, 15, 16, 17, 18, 25, should be a weekend project each for anyone with 6 months to a year of serious programming effort's worth of practice.

I... I really don't even know what I can offer to help you if this is where you're stuck.

I guess maybe three things: 1) Design Patterns, 2) An easier language that gets out of your way (e.g. Small talk), 3) get good at reading documentation.

Because seriously, anyone proficient at 1 and 3 should be able to tackle pretty much any of the yellow ones in about a week.

Maybe as a brain twister and to get good at these things, tackle some of these green ones (and maybe a few yellow ones) with the Factor programming language. Really makes you think about how programming works!

Anyway... rolling (and I'll do what I roll in Factor).

Done it before (CHIP-8 counts, right?). Re-rolling.

more math autism than programming

>With python
>import solution
yeah realy meaningfull exercise m8

return 100 ?

Let's roll for Prolog.

rolling for green

Enjoy your CS career.

>fizzbuzz

void main(void)
{
const int MAX = 100;
int i = 0;
for (; i < MAX; ++i) {
if (! i % 3) {
printf("fizz");
}
if (! i % 5) {
printf("buzz");
}
if (i % 3 && i % 5) {
printf("%d", i);
}
printf("\n");
}


hard as fuck, rerolling

>webpage crawler
what would it be supposed to do, though

cryptopals.com/

Roll

roll

roll

Roll (wont do if red xD)

>xD
great job on getting a red one tho

Roll

do it pussy

Roll tide

Roroll

Roll

The point was not solving the equation but showing two representations fuckwit.

rll

Go easy on me please

Too hard. Rerolling

>programming in your own time of your own volition

get a job losers

Bring it on

rollan

These are too difficult.

Rolling, fuck anything purple or red

roll

Roll

>beginner tier compilers are hard

How do you even get started with something like this?

>read Wirths compiler book about implementing Oberon-0
>read some stuff in the many thousands hobby c compilers on shithub
>implement amateurish compiler, using GCCs preprocessor, assembler, linker and glibc
That said, it might take a few hours. And by hours, I mean months.

>145
should i just use
post_id%145

I've made progress off and on.

My solutions, if anyone is interested (spoiler alert: has answers):

github.com/pdimitratos/ProjectEuler/tree/master/ProjectEulerSolutions/ProjectEulerSolutions/Problems

I find a test suite very useful since the problems are usually given in a way that includes a trivial example for you to validate your logic against. Like, problem 26 tells you the expected answer for denominators between 2 and 10, and then asks you to find the answer for denominators between 2 and 1000. Getting the first test to pass shows that your approach is right and then it's just a matter of making it more efficient (if needed).