Show HN: PyBites Code Challenges
pybit.es
Show HN: PyBites Code Challenges
1–10 of 13 posts
Re: Show HN: PyBites Code Challenges
#2(Though it's more about solving puzzles than what this code challenge seems to be aiming for.)
Re: Show HN: PyBites Code Challenges
#3So far I've got a time of around 1 second on the first challenge. It's nice to be able to practice my profiling and see how low I can get it!
Re: Show HN: PyBites Code Challenges
#4I think I'll enjoy doing this. As a teacher with less free time, these tasks seem short and will keep my brain "puzzling" over code without the stress of a high priority project looming in the background. So far I've got a time of around 1 second on the first challenge. It's nice to be able to practice my profiling and see how low I can get it!
Re: Show HN: PyBites Code Challenges
#5I think I'll enjoy doing this. As a teacher with less free time, these tasks seem short and will keep my brain "puzzling" over code without the stress of a high priority project looming in the background. So far I've got a time of around 1 second on the first challenge. It's nice to be able to practice my profiling and see how low I can get it!
Hint: python -c 'help(max)'
Re: Show HN: PyBites Code Challenges
#6You're going from file->list->for loop when you can just go file->for loop.
Re: Show HN: PyBites Code Challenges
#7 v: 1 2 3 4 5 8 10
l: "|"\"eaoinrtlsu|dg|bcmp|fhvwy|k|jx|qz"
d: !/+,/l,\:'v
t@*>(+/d@_:)'t:0:"dictionary.txt"
First three lines are constructing the dictionary the template in this problem hands to you, and the last line loads the file and finds the item with the maximum scrabble dictionary score.Re: Show HN: PyBites Code Challenges
#8I don't like the solution template they propose because it will likely stall users from creativly solving the problem. I also don't think this is an idomatic solution to the problem in a pythonic way. You're going from file->list->for loop when you can just go file->for loop.
This was our first real attempt at an open challenge. We were wondering how best to push it. The idea behind the template was to simplify it for the newer coders, almost like a hint.
Definitely loving the feedback! It's the only way to learn!
Re: Show HN: PyBites Code Challenges
#9See also http://www.pythonchallenge.com (Though it's more about solving puzzles than what this code challenge seems to be aiming for.)
Re: Show HN: PyBites Code Challenges
#10 my %scrabble_scores = (
1 => [qw( E A O I N R T L S U )],
2 => [qw( D G )],
3 => [qw( B C M P )],
4 => [qw( F H V W Y )],
5 => [qw( K )],
8 => [qw( J X )],
10 => [qw( Q Z )]);
my $dict = "/usr/share/dict/words";
open my $d, " 0);
while () {
my $score = 0;
chomp;
for my $c (split//) {
$score += $a{uc($c)};
}
@maxscore = ($_ => $score) if $score > $maxscore[1];
}
print "$maxscore[0] => $maxscore[1]\n";
Arguable more readable than python