Skip to content

Commit

Permalink
Remove Constants
Browse files Browse the repository at this point in the history
M is superflous, since we allocate V dynamically
N becomes a function argument
  • Loading branch information
HeinrichHartmann committed Mar 12, 2016
1 parent 529e04b commit 1c8c73b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Primes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
--
-- Changes:
-- - literal tranlation to lua
-- - remove constants
--

local N = 100
local M = 10
function PRIME() -- PROCEDURE DECLARATION;
function PRIME(N) -- PROCEDURE DECLARATION;
local X, SQUARE, I, K, LIM, PRIM -- DECLARATION OF VARIABLES;
local P, V = {}, {}
P[1] = 2 -- ASSIGNMENT TO FIRST ELEMENT OF p;
Expand Down Expand Up @@ -41,4 +40,4 @@ function PRIME() -- PROCEDURE DECLARATION;
print(X)
end
end
PRIME()
PRIME(100)

0 comments on commit 1c8c73b

Please sign in to comment.