>>> world.pickup("npc")
Sorry, but I am not single!
>>> world.pickup("npc")
Just leave me alone, will you?
>>> world.pickup("npc")
You do it one more time, and I feed you to those rats!
>>> world.pickup("npc")
Game over.
>>> world.pickup("rat")
The rat bites you and you start bleeding.
Game over.
>>> world.pickup("gun") # ...or basically anything else
There is no ... here.
It is bad practice to create a list in the sum function. A generator will not allocate memory. Also, I find x and y to be better names for points in this, i.e. math, domain.
Using package not in the standard python library like numpy, to test others is not very good.
I think we come here to train language , not the special library.
Very impressive solution! Took me a while to understand how it works but when it clicked i was amazed by the simple but effective idea. Also, very good use of numpy arrays.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
So much missed potential...
etc.
Oh, and please add apostorphes! (like
"dont"
)Fixed
This comment is hidden because it contains spoiler information about the solution
It is bad practice to create a list in the sum function. A generator will not allocate memory. Also, I find x and y to be better names for points in this, i.e. math, domain.
Using package not in the standard python library like numpy, to test others is not very good.
I think we come here to train language , not the special library.
I added a test to see if the returned object is of the correct class.
thanks. i really like list comprehensions and generator expressions so i wanted to apply them to this case.
I knew someone would come up with a very clever solution... but a one liner for this? Im trully impressed.
Very impressive solution! Took me a while to understand how it works but when it clicked i was amazed by the simple but effective idea. Also, very good use of numpy arrays.
Nice! I love one liners. Expecially when they are an upgrade with no downsides like this one.
Something like this: array.map(el => el). No printing, just visiting each element and returning it.
Edit: accidental double post due to slow site
Test 5 in the default example tests is indeed correct.
Read the description more carefully.
Loading more items...