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.
30 Comments - Last post 1 hour ago by brivid0boy
450 Comments - Last post 2 hours ago by klingki
7 Comments - Last post 7 hours ago by xXSAFOXx
16,297 Comments - Last post 8 hours ago by SebastianCrenshaw
52 Comments - Last post 9 hours ago by adam1224
206 Comments - Last post 12 hours ago by Joey2741
31 Comments - Last post 13 hours ago by Pika8
48 Comments - Last post 3 minutes ago by Mhol1071
51 Comments - Last post 4 minutes ago by raydotn
46 Comments - Last post 14 minutes ago by Butterkatt
283 Comments - Last post 50 minutes ago by Thexder
202 Comments - Last post 1 hour ago by xkingpin
7,979 Comments - Last post 1 hour ago by eeev
137 Comments - Last post 1 hour ago by TheAgonist00
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.