This repository was archived by the owner on May 15, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4545 <block type =" math_mul" />
4646 <block type =" math_div" />
4747 <block type =" math_pow" />
48+ <block type =" math_mod" />
4849 <block type =" math_log" />
4950 <sep gap =" 48" ></sep >
5051 <block type =" math_random" />
Original file line number Diff line number Diff line change @@ -177,6 +177,33 @@ function register() {
177177 const code = `(${ X } ** ${ Y } )` ;
178178 return [ `${ code } ` , 0 ] ;
179179 } )
180+ registerBlock ( `${ categoryPrefix } mod` , {
181+ message0 : '%1 % %2' ,
182+ args0 : [
183+ {
184+ "type" : "field_number" ,
185+ "name" : "X" ,
186+ "check" : "Number" ,
187+ "value" : 1 ,
188+ "acceptsBlocks" : true
189+ } ,
190+ {
191+ "type" : "field_number" ,
192+ "name" : "Y" ,
193+ "check" : "Number" ,
194+ "value" : 1 ,
195+ "acceptsBlocks" : true
196+ }
197+ ] ,
198+ output : "Number" ,
199+ inputsInline : true ,
200+ colour : categoryColor
201+ } , ( block ) => {
202+ const X = javascriptGenerator . valueToCode ( block , 'X' ) ;
203+ const Y = javascriptGenerator . valueToCode ( block , 'Y' ) ;
204+ const code = `(${ X } % ${ Y } )` ;
205+ return [ `${ code } ` , 0 ] ;
206+ } )
180207 registerBlock ( `${ categoryPrefix } log` , {
181208 message0 : 'log %1 %2' ,
182209 args0 : [
You can’t perform that action at this time.
0 commit comments