Show HN: Astro-Bot – A programming question with every new tab (chrome.google.com) 46 points by hadeon 7y ago ↗ HN
[–] svet_0 7y ago ↗ Pretty cool! However, some riddles are incorrect, for example this one has two errors: def foo( vals ): output = vals[0] for x in vals[1:]: if output < x: output = x return x 1. It should return output2. The answer should be "The maximum value", not "The minimum value"Also, it could be nice if after you solve a riddle you would get a new one. [–] hadeon 7y ago ↗ Thanks for pointing this out! It's fixed now
[–] teddyh 7y ago ↗ Wouldn’t a better idea be to show a question on Stack Overflow which is somewhat upvoted but still without an accepted answer? [–] v01d4lph4 7y ago ↗ Sounds good, doesn't work. [–] gitgud 7y ago ↗ Doesn't work as in technically? or the concept? or legally? [–] passwd 7y ago ↗ If the question is remaining unanswered for a while, it's probably beyond open-new-tab kind of timespan to answer it.
[–] v01d4lph4 7y ago ↗ Sounds good, doesn't work. [–] gitgud 7y ago ↗ Doesn't work as in technically? or the concept? or legally?
[–] passwd 7y ago ↗ If the question is remaining unanswered for a while, it's probably beyond open-new-tab kind of timespan to answer it.
[–] grimoire_ghost 7y ago ↗ #include<stdio.h>int main() { int array[] = { 1, 2, 3, 4, 5}; int *ptr; ptr = a; ptr++; return 0; }This won't compile, but the answer says it should be 2 [–] hadeon 7y ago ↗ Thank you, it's fixed now.
[–] nightraven97 7y ago ↗ Nice! It would be cool if there was some kind of points to denote how many questions we have answered correctly. [–] hadeon 7y ago ↗ Scores will be coming in the next few days. I'm also planning on adding an (opt-in) leaderboard so you can see how you compare to other people.Is a leaderboard something that would appeal to you?
[–] hadeon 7y ago ↗ Scores will be coming in the next few days. I'm also planning on adding an (opt-in) leaderboard so you can see how you compare to other people.Is a leaderboard something that would appeal to you?
[–] anandkulkarni 7y ago ↗ I enjoyed it, but you should allow me to disable random HackerNews links. That's not the purpose of the extension. [–] hadeon 7y ago ↗ Great suggestion - I'll add an option to disable that.
[–] cift 7y ago ↗ Is there a Firefox version? [–] hadeon 7y ago ↗ It will be coming this week or next - I'll reply here when I've released it.
[–] seg12 7y ago ↗ The following is incorrect for finding a missing number in a sequence. func foo( _ nums: [Int] ) -> Int { var sum = 0 var _ = nums.map {sum += $0} return (nums.count * ((nums.count+1) / 2)) - sum } The last line should be return ((nums.count+1) * ((nums.count+2) / 2)) - sum The count of nums will give the incorrect answer since it's already missing a value. [–] hadeon 7y ago ↗ You're absolutely right, thanks for noticing this. There was also a bug with the parentheses I hadn't caught.
[–] hadeon 7y ago ↗ You're absolutely right, thanks for noticing this. There was also a bug with the parentheses I hadn't caught.
[–] ngcazz 7y ago ↗ $ git checkout -b feature The answer to this is wrong -- got green on "merge two branches" rather than "create and then checkout a new branch called 'feature'". [–] hadeon 7y ago ↗ Ha whoops, thank you for noticing this -- I've updated the answer.
[–] wink 7y ago ↗ Why would I want to be distracted while doing a task that serves a certain purpose? I must be the only one not just opening new tabs out of boredom :P [–] hadeon 7y ago ↗ That's actually why I made it so nothing happens after you answer a question. Ideally you open a tab and every now and then you take a minute or so to think one over and answer.
[–] hadeon 7y ago ↗ That's actually why I made it so nothing happens after you answer a question. Ideally you open a tab and every now and then you take a minute or so to think one over and answer.
21 comments
[ 3.0 ms ] story [ 61.6 ms ] thread2. The answer should be "The maximum value", not "The minimum value"
Also, it could be nice if after you solve a riddle you would get a new one.
int main() { int array[] = { 1, 2, 3, 4, 5}; int *ptr; ptr = a; ptr++;
}This won't compile, but the answer says it should be 2
Is a leaderboard something that would appeal to you?