User Tools

Site Tools


notes:discrete:fall2021:projects:pnf1

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
notes:discrete:fall2021:projects:pnf1 [2021/09/09 02:59] – Fixed up spacing of sections on page smalik3notes:discrete:fall2021:projects:pnf1 [2021/09/09 03:59] (current) – [Prime Detection Algorithm] mbrill1
Line 116: Line 116:
 An if statement can be used to accept two conditions instead of just one. In Lua, this is accomplished with `and.` As an example, `if a==2 and b==3 then` only performs an action if a=2 and b=3. This is useful for having multiple menus and deciding which sub-menu to display. It can also be used in conjunction with Optional Functionality. An if statement can be used to accept two conditions instead of just one. In Lua, this is accomplished with `and.` As an example, `if a==2 and b==3 then` only performs an action if a=2 and b=3. This is useful for having multiple menus and deciding which sub-menu to display. It can also be used in conjunction with Optional Functionality.
  
 +
 +====Break On Composite Algorithm====
 +
 +The idea of the "break on composite algorithm", is very similar to the brute force algorithm. It still incorporates the trial by division idea. Lets say you are checking to see if a number is prime or composite using the trial by division algorithm. That means you are dividing said number by every number between 2 and said number. If it so happens that you come across a number that divides into your number with no remainder, then you would want your program to instantly see that your number is composite. Then move on to the next number in the range of numbers provided by the user.
 ====Display==== ====Display====
  
notes/discrete/fall2021/projects/pnf1.1631156351.txt.gz · Last modified: 2021/09/09 02:59 by smalik3