convert to Integer before using .times
This commit is contained in:
parent
53e1614081
commit
8ac18e6517
1 changed files with 2 additions and 2 deletions
|
@ -59,7 +59,7 @@ module Rpl
|
||||||
# duplicate n first stack entries
|
# duplicate n first stack entries
|
||||||
def dupn( stack, dictionary )
|
def dupn( stack, dictionary )
|
||||||
stack, args = Rpl::Lang::Core.stack_extract( stack, [%i[numeric]] )
|
stack, args = Rpl::Lang::Core.stack_extract( stack, [%i[numeric]] )
|
||||||
n = args[0][:value]
|
n = args[0][:value].to_i
|
||||||
stack, args = Rpl::Lang::Core.stack_extract( stack, %i[any] * args[0][:value] )
|
stack, args = Rpl::Lang::Core.stack_extract( stack, %i[any] * args[0][:value] )
|
||||||
|
|
||||||
args.reverse!
|
args.reverse!
|
||||||
|
@ -76,7 +76,7 @@ module Rpl
|
||||||
# push a copy of the given stack level onto the stack
|
# push a copy of the given stack level onto the stack
|
||||||
def pick( stack, dictionary )
|
def pick( stack, dictionary )
|
||||||
stack, args = Rpl::Lang::Core.stack_extract( stack, [%i[numeric]] )
|
stack, args = Rpl::Lang::Core.stack_extract( stack, [%i[numeric]] )
|
||||||
n = args[0][:value]
|
n = args[0][:value].to_i
|
||||||
stack, args = Rpl::Lang::Core.stack_extract( stack, %i[any] * args[0][:value] )
|
stack, args = Rpl::Lang::Core.stack_extract( stack, %i[any] * args[0][:value] )
|
||||||
|
|
||||||
args.reverse!
|
args.reverse!
|
||||||
|
|
Loading…
Reference in a new issue