mirror of
https://github.com/arnaucube/circom.git
synced 2026-02-07 19:26:43 +01:00
for loops
This commit is contained in:
14
test/circuits/forrolled.circom
Normal file
14
test/circuits/forrolled.circom
Normal file
@@ -0,0 +1,14 @@
|
||||
template ForRolled() {
|
||||
signal input in;
|
||||
signal output out;
|
||||
|
||||
var acc = 0;
|
||||
|
||||
for (var i=0; i<in; i = i+1) {
|
||||
acc = acc + 1;
|
||||
}
|
||||
|
||||
out <== acc;
|
||||
}
|
||||
|
||||
component main = ForRolled();
|
||||
Reference in New Issue
Block a user