Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
c# translation
Approved
python new test framework is required. updated in this fork
Because of the suggestions below, here is the translation which should upgrade this kata to the newest version and remove restrictions of the older versions: https://www.codewars.com/kumite/6308dcade5ae64004ac017b6?sel=6308dcade5ae64004ac017b6
Really needs to be able to use a much newer compiler. That being said, I got major dopamine release when I solved it.
Would be nice to update to a newer sol version, was quite a challenge to make it.
That being said, thanks for the challenge ;)
I'm surprised to see that kind of katas which are close to real-life are still created now, especially if they are about economics and store politics.
Of course I like it and hope this will get out of beta, now time to upgrade this with v.0.8.16 :)
P.S. As far as I understand, contracts are like classes in other languages, am I right?
Can confirm that as of now Kata is fully working. However use of old version of Solidity along with rather poor tests make it not very enjoyable as it was hard to understand whether the tests were broken or the code.
I also feel like both
assert
andrequire
should work here. And since onlyassert
works it needs to be specified in descriptionThe
buyItem
tests are broken. The code related to checking the owner's balance fails (it seemsweb3.eth.getBalance(owner)
is the culprit) and leads to the following error message:I have commented it out to make the kata completable but either this test should be fixed (unless this is actually a problem with the platform which only the admins might be able to deal with), or the requirement about transfering the money should be removed.
If anyone else has the same issues let me know.
The test doesn't check for ''
If you set the greeting back to '', should it return 'Hello world!' or ''?
Thanks ~^^
Are you switching to solidity ^0.4.13 when moving the contract from local environment to online environment?
Can I get some specifics? I'm having trouble understanding the issue. Can you send me more info, like which one of the tests is broken and the error you are getting.
The getItem function should not ONLY be accessible by the owner. This function IF used in the real world (Do your own testing on your real world dapp's) would be hypothetically used to send all available items for sale to a potential buyer in a dapp. But really, this function was mainly made for testing purposes. So I don't think there is a need to throw errors or use event handlers. If you feel differently or if I totally misunderstood what you were saying, let me know.
Loading more items...