shigoto-dev19 / zk-battleships-solana Goto Github PK
View Code? Open in Web Editor NEWFirst decentralized & private Battleships game on Solana. Honorable Mention recognition in Solana Grizzlython Hackathon
First decentralized & private Battleships game on Solana. Honorable Mention recognition in Solana Grizzlython Hackathon
ZK-Battleships-Solana/test/game.test.ts
Line 106 in 6653dee
ZK-Battleships-Solana/src/utils.ts
Line 14 in 39e42bc
ZK-Battleships-Solana/src/utils.ts
Line 75 in 39e42bc
ZK-Battleships-Solana/src/utils.ts
Line 24 in 39e42bc
ZK-Battleships-Solana/src/gameSimulation.ts
Line 177 in 39e42bc
apart from very initial testing you will want this to crash your test or client
If you move this to the constructor you don't need to pass it in, since it is a constant.
ZK-Battleships-Solana/test/game.test.ts
Line 24 in 6653dee
change:
async turnData(gameID: number, _hit: Binary, player_shot: Array, enemy_shot: Array) {
to:
async turnData({gameID: number, _hit: Binary, player_shot: Array, enemy_shot: Array}) {
maybe you need to do:
async turnData({gameID, _hit, player_shot, enemy_shot}: {gameID: number, _hit: Binary, player_shot: Array, enemy_shot: Array}) {
then the function call will look like:
client.turnData({
gameID: 1,
_hit: 1,
player_shot: {0,1},
enemy_shot: ?? this doesn't make sense does it?, how do I know the enemy shot at the same time as mine it is a different round?
// Ah you prove your own shot and whether the enemy's last shot hit in the same proof, why do you need to prove your own shot?
})
ZK-Battleships-Solana/test/game.test.ts
Line 106 in 6653dee
Your file is just 100 lines long, why nest this test?
It is a lot worse for readability and just another 100 lines
ZK-Battleships-Solana/src/utils.ts
Line 60 in 39e42bc
make it a parameter in the class, initialize it once, then use it with this.F
ZK-Battleships-Solana/src/utils.ts
Line 9 in 39e42bc
const boardHash = await mimcSponge.multiHash(board.flat());
should be
const boardHash = await this.mimcSponge.multiHash(board.flat());
ZK-Battleships-Solana/src/utils.ts
Line 42 in 39e42bc
https://github.com/Shigoto-dev19/ZK-Battleships-Solana/blob/master/src/battleShipClient.ts#L93
should be:
this.F.toObject(this.boardHash)
ZK-Battleships-Solana/test/game.test.ts
Line 60 in 6653dee
you can append or prepend if you want.
player1Host idk
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.