Assignment - Get Kitty

Create a getKitty function that will return all properties of the cat.

1 Like
 function getBear(uint256 _tokenId) public view returns(uint256 genes, uint64 birthTime, uint32 mumId, uint32 dadId, uint16 generation) {
        return (
                bears[_tokenId].genes, 
                bears[_tokenId].birthTime, 
                bears[_tokenId].mumId, 
                bears[_tokenId].dadId, 
                bears[_tokenId].generation
                );
    }
1 Like
function getKitty(uint256 tokenId)public view returns(uint256, uint64, uint32, uint32, uint16){
        return (kitties[tokenId].genes, kitties[tokenId].birthTime, kitties[tokenId].mumId, kitties[tokenId].dadId, kitties[tokenId].generation);
    }

I just watched filips video, i learned like 3 new tricks, with that video *o *, will update my code accordingly.

1 Like