'NFT Breeding function in solidity like cryptokitties

How Do I write a function in solidity to breed nfts and generate a new one like cryptokitties?



Solution 1:[1]

Using the DNA algorithm.

Create a hex string like 0x03FB, each character [0,3,F,B] identify for the skin color, stall, eye color, tail color.

By combine two kitties, you can do the XOR operator for two DNAs of the kitties to create a new one.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 PySoL