This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.grampabacon.shors; | |
import static java.lang.String.format; | |
import java.util.Arrays; | |
import java.util.List; | |
import java.util.Random; | |
import org.mathIT.numbers.Numbers; | |
import org.mathIT.quantum.Circuit; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pathlib | |
from PIL import Image | |
# Layer the transparent cat onto a solid pink background image and save. | |
def create_cat(id): | |
image = Image.open("Paper_Cat_Transparent.png") | |
path = "cats/" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
# Generate a random (but bounded) RGB value, run it through the HSL algorithm | |
# Run recursively until we are happy that the colour looks good. | |
def get_background_colour(): | |
r = random.randint(100, 255) | |
g = random.randint(100, 255) | |
b = random.randint(100, 255) | |
light = lightness(r, g, b) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pathlib | |
from PIL import Image | |
# Layer the transparent Paper Cat onto a random solid coloured background. | |
def create_cat(id): | |
image = Image.open("Paper_Cat_Transparent.png") | |
path = "cats/" | |
new_image = Image.new("RGB", image.size, get_background_colour()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image, ImageDraw | |
import pathlib | |
def create_cat_with_heart(id): | |
image = Image.open("Paper_Cat_Transparent.png") | |
path = "heart_cats/" | |
new_image = Image.new("RGB", image.size, get_background_colour()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.0; | |
import '@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol'; | |
import '@openzeppelin/contracts/access/Ownable.sol'; | |
contract PaperCats is ERC721Enumerable, Ownable { | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.0; | |
import '@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol'; | |
import '@openzeppelin/contracts/access/Ownable.sol'; | |
contract PaperCats is ERC721Enumerable, Ownable { | |
string _baseTokenURI; | |
constructor(string memory baseURI) ERC721("Paper Cats", "PCATS") { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uint256 public _price = 0.0005 ether; | |
address _communityWallet = 0xB93A6D9D539e7EDB0858Eb53a3e1501d51935752; | |
function setPrice(uint256 _newPrice) public onlyOwner { | |
_price = _newPrice; | |
} | |
function withdrawAll() public onlyOwner { | |
require(payable(_communityWallet).send(address(this).balance)); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool public _paused = true; | |
function pause(bool val) public onlyOwner { | |
_paused = val; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function walletOfOwner(address _owner) public view returns(uint256[] memory) { | |
uint256 tokenCount = balanceOf(_owner); | |
uint256[] memory tokensId = new uint256[](tokenCount); | |
for(uint256 i; i < tokenCount; i++) { | |
tokensId[i] = tokenOfOwnerByIndex(_owner, i); | |
} | |
return tokensId; | |
} |
OlderNewer