Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: correct downloadable files and verify logic for Challenge #4 #23

Merged
merged 1 commit into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions packages/nextjs/app/engineering/circom/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ export default async function Page({ params }: PageProps) {
<div>
<p>{item.description}</p>
<pre>{item.commands.join("\n")}</pre>
{/* TODO: Adjust the downloadable files */}
{/* <a href={`/challenges/challenge_${item.downloadableFile}/files/download.circom`} download>
{item.downloadableFile}
</a> */}
{item.files && (
<a href={`/challenges/challenge_${challengeId}/files/${item.files}`} download={`${item.files}`}>
Download: {item.files}
</a>
)}
</div>
}
/>
Expand Down
21 changes: 18 additions & 3 deletions packages/nextjs/public/challenges/challenge_4/statement.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,30 @@
const Challenge4Content = () => (
<div className="w-full max-w-[64rem] p-4 bg-gray-700 rounded-lg mb-6 font-play shadow-lg">
<div className="mb-4">
<h3 className="text-white text-xl font-bold">Statements</h3>
<h3 className="text-white text-xl font-bold">Puzzle: Knights and Knaves</h3>
<p className="text-gray-300">
This is a classic logic puzzle involving two characters, A and B. Each character is either a knight, who always tells the truth, or a knave, who always lies. Your task is to determine who is the knight and who is the knave based on their statements.
</p>
</div>
<div className="mb-4">
<h4 className="text-white text-lg font-bold">Rules</h4>
<ul className="text-gray-300">
<li>- Knights always tell the truth.</li>
<li>- Knaves always lie.</li>
</ul>
</div>
<div className="mb-4">
<p className="text-gray-300">Character A: B is a knave.</p>
<p className="text-gray-300">Character B: A and I are of opposite types.</p>
<h4 className="text-white text-lg font-bold">Statements</h4>
<ul className="text-gray-300">
<li>Character A: "B is a knave.</li>
<li>Character B: "A and I are of opposite types.</li>
</ul>
</div>
<div className="mb-4">
<h4 className="text-white text-lg font-bold">Task</h4>
<p className="text-gray-300">
Write a circuit in Circom that receives the selected value for each character and that the circuit can identify whether the selection of characters is correct or not. The circuit must be compiled using the PLONK protocol.
</p>
</div>
</div>
);
Expand Down
4 changes: 2 additions & 2 deletions packages/nextjs/public/challenges/challenge_4/steps.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"title": "Challenge 4 title",
"title": "Knights and Knaves - Plonk",
"steps": [
{
"step": "Step 1",
"description": ["Create the circuit in Circom (Knightsknaves.circom)"],
"commands": [""],
"files": ["../../../../package/circuits/KnightsKnaves.circom"]
"files": ["KnightsKnaves.circom"]
},
{
"step": "Step 2",
Expand Down
Loading