I've done no programming that has to do with the internet, just some basic ADA programming at the university (mandatory programming class), which I was quite good at, for a noob! Got the highest possible score at the final exam.
I'll give this a go and see what happens. Messed around and got the perhaps comical "cannot get some" message, poor server :D
Comment has been collapsed.
It's a simple modulus. I have a working solution but ITH doesn't seem to like the variable names that I'm using; is there a way to somehow generalize them in C#?
Comment has been collapsed.
never touched ruby before now, think i have the answer but it wont take, I tested @ repl.it and get the right output.
Am I close?
> m1
undefined local variable or method `m1' for #<Context:0x00000000b63d70>
(repl):1:in `initialize'
> m2
undefined local variable or method `m2' for #<Context:0x00000000b63d70>
(repl):1:in `initialize'
> [:m1, :m2].each do |m|
.. eval "def #{m}; puts :#{m}; end"
.. end
=> [:m1, :m2]
> m1
m1
=> nil
> m2
m2
=> nil
Comment has been collapsed.
That's a completely valid answer. I prefer to avoid eval because it is usually seen as a security risk and a bad practice, but if no one can come up with the actual answer I'll add it as valid.
Basically, you need to dynamically define methods without using eval.
Comment has been collapsed.
Finally I found the correct shortest code. Damn annoying when half of the online ruby compilers tell me they don't know define_method, and one that doesn't complain about the method doesn't let me write []{}.
Once I finally found a useful compiler I finally was able to work on a solution. Probably would have been easier if I actually had real Ruby practice instead of just doing a short tutorial a few months ago.
Comment has been collapsed.
After some searching I found this. I then used it for C too since I had it open already.
I also tried the one you used, but for some strange reason I am not able to enter [,],{ and } there (maybe cause I'm not using an English keyboard layout?). Copy&paste also doesn't work there, so I had to find something else.
Comment has been collapsed.
I tried something very similar. Code works but it is not the correct answer either.
void fun(char**a,char*b,char*c){strcpy(c,*a);strcat(c,b);}
Comment has been collapsed.
Thanks, couldn't figure out why it wasn't working. Was the wrong character. :)
Comment has been collapsed.
There must be a different string function that can do this. Maybe it is possible in one line instead of two.
Comment has been collapsed.
void fun(char**a,char*b,char*c){memcpy(c,*a,5);memcpy(c+5,b,10);}
This also works but it is not the right answer.
Comment has been collapsed.
That (your first comment) was one of the answers I was looking for (the other one being two strcpy (the one that gorok found 3 seconds before this comment lol xD)), but for some reason it wasn't listed as solution. Just added it! Sorry for the inconveniences.
Comment has been collapsed.
Thanks OpNop;
its still not accepting it... i paste the code starting with $.post(); in the textbox with the check button.. am i doing something wrong?
will an alert suffice like so:
function(data,status){
alert("Data: " + data + "\nStatus: " + status);
}
dont want to post my soln here without spoiling it for everyone...
Comment has been collapsed.
You need to do the actual POST yourself to "http://ithpuzzle.herokuapp.com/some/url", when you do it, you will get a message back from the server to paste as the answer.
so to clarify, the correct answer is NOT how to POST, but the data you get back from the POST
Comment has been collapsed.
wow, can't believe I figured out the GLSL one. Just started messing around @ https://www.shadertoy.com and looking for math functions and boom found it
Comment has been collapsed.
Thanks for the fun puzzles! It looks like there is quite a bit of interest in this type of puzzle, given that the solution came many hours before the hints were revealed.
Comment has been collapsed.
Bump for solved, if solved is the right word - the second puzzle was done before I got there!
Comment has been collapsed.
Aww, it seems I arrived late. It seems it was fun, though. Thanks!
Comment has been collapsed.
Have a shy bump from a non-programmer.
Got the first one right though - the second one was already done - but the questions and answers made for an interesting read. Thank you for the puzzles :D
Comment has been collapsed.
BUMP for the nice puzzle :) (though it seems I'm quite late)
Comment has been collapsed.
16 Comments - Last post 15 minutes ago by hbarkas
47,159 Comments - Last post 1 hour ago by Calibr3
6 Comments - Last post 1 hour ago by lostsoul67
818 Comments - Last post 1 hour ago by Redpoison11
372 Comments - Last post 2 hours ago by Wok
166 Comments - Last post 4 hours ago by paco7533
19 Comments - Last post 11 hours ago by juryman00
240 Comments - Last post 2 minutes ago by RhoninMagus
2,539 Comments - Last post 9 minutes ago by Dizzard
19 Comments - Last post 45 minutes ago by Mikurden
75 Comments - Last post 47 minutes ago by vigaristti
16 Comments - Last post 49 minutes ago by cheeki7
62 Comments - Last post 57 minutes ago by TheMuzo
718 Comments - Last post 1 hour ago by Saikania
This may end up being a total failure. I hope it does not :P
So it is a puzzle for programmers (actually, 2 puzzles).
The first puzzle will be used as filter and solving it will give you access to 3 bundle GAs (no CV requirement) and the second puzzle.
The second puzzle will be a group puzzle (shared answers) with questions related to different programming languages, and solving it will give you access to 1 bundle and 1 no bundle GA (great game IMHO).
I'm not sure how many programmers are here in SG, neither how many enjoy solving puzzles, so I made it a group puzzle to avoid having no solvers. If it turns out to be too easy, there is always time for a future harder puzzle :D
Please post all the second puzzle questions/thoughts/shared breakthroughs in this thread and not in the GAs :D
Without further ado, the puzzle.
I hope you enjoy it.
Countdown
EDIT: Added languages poll: poll
EDIT2: It seems I forgot about the most used lang according to the poll. My apologies to the java coders U_U
EDIT3: It would we nice if the solvers post here the code used to solve it (for those questions where the answer is not the code itself) :D
Comment has been collapsed.