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

examples: add simple palindrome checkers #140

Merged
merged 1 commit into from
Apr 8, 2024

Conversation

arajasek
Copy link
Contributor

@arajasek arajasek commented Apr 5, 2024

This PR adds another simple example, this one checking whether strings and integers (both decimal and binary) are palindromes.

I created this just to play with the prover, so feel free to merge if useful, or just close otherwise.

Sample output:

Executing program...
madam is a string palindrome
23432 is a decimal palindrome
33 is a binary palindrome
Executed 4080 instructions in 140.147812ms. 1607560 bytes used by trace.
  Loading public parameters ... 3.9s
 Finished in 3.9s
  Computing step 0 ... 852ms
.
.
.
Computing step 254 ... 985ms
Proved 255 step(s) in 4min5s; 16.62 instructions / second
Saving proof ... 61ms
Finished in 61ms

Copy link

vercel bot commented Apr 5, 2024

@arajasek is attempting to deploy a commit to the Nexus Labs Team on Vercel.

A member of the Team first needs to authorize it.

@danielmarinq
Copy link
Contributor

Nice example! @sjudson is working on the examples / applications.

Sam, can you take a look?

Copy link

vercel bot commented Apr 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nexus-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 8, 2024 0:57am

@sjudson
Copy link
Contributor

sjudson commented Apr 5, 2024

@arajasek this looks like a really nice example, as it tests a broad set of instructions for the VM. Thank you very much for it!

Any chance you might be able to add a few negative test examples as well? I'm also happy to do so myself, but appreciate your contribution and want to give you the opportunity to do so first.

@arajasek
Copy link
Contributor Author

arajasek commented Apr 5, 2024

@arajasek this looks like a really nice example, as it tests a broad set of instructions for the VM. Thank you very much for it!

Any chance you might be able to add a few negative test examples as well? I'm also happy to do so myself, but appreciate your contribution and want to give you the opportunity to do so first.

You're welcome, I thought it'd be nice to get some bit manipulation in an example.

I'm happy to add some negative examples, will do so soon (afk rn).

@arajasek arajasek force-pushed the asr/palindrome-example branch from 6c3e540 to b21232d Compare April 7, 2024 15:04
@arajasek
Copy link
Contributor Author

arajasek commented Apr 7, 2024

@arajasek this looks like a really nice example, as it tests a broad set of instructions for the VM. Thank you very much for it!

Any chance you might be able to add a few negative test examples as well? I'm also happy to do so myself, but appreciate your contribution and want to give you the opportunity to do so first.

Added negative examples too!

@sjudson
Copy link
Contributor

sjudson commented Apr 8, 2024

They look great, thanks again.

@sjudson sjudson merged commit a3a2b15 into nexus-xyz:main Apr 8, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants