Much Flip Game: Bootcamp Workshop zkApp

Much Flip Game: Bootcamp Workshop zkApp

zkApp – Much Flip Game: Much Flip Coin is a challenging game built with SnarkyJS. Players must guess the computer’s choice and try to outsmart it.

Motivation

Carbonara aimed to provide an engaging and enjoyable introduction to SnarkyJS through this repository. The game’s logic is straightforward: it operates in rounds, with the code randomly selecting “Heads” or “Tails” at the start of each round. Players are tasked with predicting the code’s choice.

How it works under the hood

The game’s logic comprises two main components. Firstly, the user initiates the game, prompting the deployment of the contract. Then, the application determines the winning side through a transaction, followed by the user’s submission of their guessed side. The project is technically divided into two parts: the “smart contract” logic in the src/snapp folder and the rest of the logic/UI in the src/lib folder.

Of particular interest is the snapp folder, housing two key files:

  • contract.ts
  • helpers.ts

The contract.ts file contains the actual contract featuring two essential methods, startRound() and submitGuess(). On the other hand, the helpers.ts file includes various functions to facilitate the invocation of the contract methods, such as variable casting and validation.

Türkçe

SNAPP – Much Flip Game Much Flip Coin, SnarkyJS (o1js) ile oluşturulmuş “çok zor” (çok zor, jk) bir oyundur. Bilgisayarınızın ne düşündüğünü tahmin etmeniz ve onu yenmeniz gerekmekte. Motivasyon Bu depo ile SnarkyJS’e başlamak için ilgi çekici ve eğlenceli bir deneyim yaratmak istedim.

Oyunun mantığı çok basit. Oyun turlar halinde oynanıyor, her turun başında kod bir “Yazı” veya “Tura” seçer, siz bir oyuncu olarak kodun ne seçtiğini tahmin etmeniz gerekir. Arkaplanda nasıl çalışır Oyun mantığı basittir. Kullanıcı oyunu başlatır, oyun kontratı deploy eder, uygulama kazanan tarafı bir işlemle belirler ve ardından kullanıcı tahmin edilen tarafla bir işlem gönderir. Teknik olarak proje iki bölüme ayrılmıştır. src/snapp klasöründeki “akıllı sözleşme” mantığı ve src/lib klasöründeki “mantığın geri kalanı/UI”.

Açıkçası ilginç kısım snapp klasöründe yatmaktadır. Snapp klasöründe iki dosya vardır: contract.ts helpers.ts contract.ts startRound() ve submitGuess() metotlarını barındıran asıl kontrattır. helpers.ts, sözleşme yöntemlerini çağırmak için kullanılan tüm yardımcılardır (örn. değişken atama, doğrulama vb.).

Hindi

कार्यशाला zkApp – मच फ्लिप गेम

“SNAPP – मच फ्लिप गेम मच फ्लिप कॉइन एक “”बहुत कठिन” (बहुत कठिन, मज़ाक कर रहे है) गेम है जो SnarkyJS के साथ बनाया गया है। आपको अनुमान लगाना होगा कि आपका कंप्यूटर क्या सोचता है और आपको इसे हराना होगा। प्रेरणा इस भंडार के साथ मैं SnarkyJS के साथ शुरुआत करने के लिए एक आकर्षक और मजेदार अनुभव बनाना चाहता था। खेल का तर्क बहुत सरल है। खेल राउंड में खेला जाता है, प्रत्येक राउंड की शुरुआत में कोड “हेड्स” या “टेल्स” चुनता है, एक खिलाड़ी के रूप में, आपको अनुमान लगाना होगा कि कोड ने क्या चुना है। यह पर्दे के पीछे कैसे काम करता है खेल-तर्क सरल है। उपयोगकर्ता गेम शुरू करता है, गेम अनुबंध तैनात करता है, ऐप लेनदेन के साथ विजेता पक्ष सेट करता है और फिर उपयोगकर्ता अनुमानित पक्ष के साथ लेनदेन भेजता है। तकनीकी तौर पर प्रोजेक्ट को दो भागों में बांटा गया है। फ़ोल्डर src/snapp में “”स्मार्ट कॉन्ट्रैक्ट”” तर्क और src/lib में “”शेष तर्क/यूआई””। जाहिर तौर पर दिलचस्प हिस्सा स्नैप फ़ोल्डर में निहित है। स्नैप फ़ोल्डर में दो फ़ाइलें हैं: contract.ts helpers.ts contract.ts वास्तविक अनुबंध है जो दो तरीकों startRound() और submitGuess() को होस्ट करता है। helpers.ts वे सभी सहायक है जो अनुबंध विधियों (जैसे वेरिएबल कास्टिंग, सत्यापन आदि) को लागू करते है।”

Featured zkApps
MAC!
Katz
Anomix
Social Cap
zkLocus
Protokit
Pado
Wordle
zkFusion
zKeeper
zk-navigators-mina-dec2023

Mina Navigators is poised to establish a groundbreaking standard for ZK developer engagement, urging innovators to embark on the journey of creating, refining, and contributing to the Mina ecosystem.

Timeline

There are three distinct phases within the Navigator program:

  1. Hackathon: October 9 through November 10
  2. Learn-to-earn challenges: November 2023 through April 2024
  3. Final contribution grant: April 30, 2024
Phase One

In Phase One, known as The Navigators Hackathon, commencing on October 9th, a five-week hackathon unfolds. Outstanding submissions during this period stand a chance to receive MINA token grants and a coveted 'Navigator' badge—a symbol of acceptance into the Navigators program. Those adorned with the badge qualify for Phase Two, engaging in monthly challenges to accrue grants.

Developers are tasked with constructing functional and efficient proof-of-concept applications and tooling for Mina. This endeavor aims to spotlight their ingenuity and technical prowess across diverse use cases on the Mina platform.

Judging involves a panel of seven individuals from the Mina ecosystem. For more comprehensive information regarding grants, submission criteria, and the judging process, the Navigators hub offers detailed insights.

Phase Two

In Phase Two, the Navigators embark on the Build and Learn-to-Earn journey (or, as they humorously term it, Navigate-to-Earn). This marks the initiation of the enjoyable phase. Post-hackathon, Navigators engage in collaborative efforts, either on their personal projects or those of their peers from the hackathon. Their active participation in a 6-month series of challenges positions them to earn monthly grants, facilitating an accelerated learning experience on ZK, Mina, and o1js.

Phase Three

As Phase Three unfolds, the Navigators, having invested six months of unwavering dedication and hard work, seize the opportunity to present their contributions. A panel of community electors becomes the discerning audience, evaluating these endeavors for the coveted grand prizes of MINA grants. Notably, these prizes distinguish themselves by being non-project-specific, emphasizing individual contributions spread across various projects and GitHub repositories.

Scroll to Top