level 1
Kmust_S丶D
楼主
print"enter function to be plotted(with variable *x*):"
local L=io.read()
local f=assert(loadstring("local x= ...;return " .. L))
for i=1,20 do
print(string.rep("*",f(i)))
end
输入了各种a(x),Q(x)都会跳错。
错误是:
[string "local x= ...;return q(x)"]:(1): attempt to call global *q* (a nil value)
Stack Traceback:
ocal x= ...;return q(x):1: in function *f*
C:\Users\Administrator\Desktop\LuaStudio\llllllua\1.lua:32: in main chunk
请问是怎么回事 。。。
小白在线等。
2014年09月14日 01点09分
1
local L=io.read()
local f=assert(loadstring("local x= ...;return " .. L))
for i=1,20 do
print(string.rep("*",f(i)))
end
输入了各种a(x),Q(x)都会跳错。
错误是:
[string "local x= ...;return q(x)"]:(1): attempt to call global *q* (a nil value)
Stack Traceback:
ocal x= ...;return q(x):1: in function *f*
C:\Users\Administrator\Desktop\LuaStudio\llllllua\1.lua:32: in main chunk
请问是怎么回事 。。。
小白在线等。

