mirror of
https://bitbucket.org/Mattrixwv/projecteulerlua.git
synced 2025-12-06 17:43:57 -05:00
Updated problems to be more in line with conventions
This commit is contained in:
10
Problem5.lua
10
Problem5.lua
@@ -1,11 +1,11 @@
|
||||
--ProjectEuler/lua/Problem5.lua
|
||||
--Matthew Ellison
|
||||
-- Created: 02-05-19
|
||||
--Modified: 03-28-19
|
||||
--Modified: 06-19-20
|
||||
--What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?
|
||||
--All of my requires, unless otherwise listed, can be found at https://bitbucket.org/Mattrixwv/luaClasses
|
||||
--[[
|
||||
Copyright (C) 2019 Matthew Ellison
|
||||
Copyright (C) 2020 Matthew Ellison
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
@@ -25,12 +25,12 @@
|
||||
require "Stopwatch"
|
||||
|
||||
|
||||
timer = Stopwatch:create();
|
||||
local timer = Stopwatch:create();
|
||||
timer:start();
|
||||
|
||||
--Setup the variables you need
|
||||
numFound = false;
|
||||
currentNum = 22; --Start looking at 22 becuase it must be divisible by 2 and greater than 20
|
||||
local numFound = false;
|
||||
local currentNum = 22; --Start looking at 22 becuase it must be divisible by 2 and greater than 20
|
||||
--Start a loop looking for the correct number
|
||||
while((not numFound) and (currentNum > 0)) do
|
||||
--Set that you found the number to true because you set this flag when you don't find it
|
||||
|
||||
Reference in New Issue
Block a user