Structured English
Different types of structured English
Sequential structure
- A block of instructions with no branching, this is the most basic form of Structured English and therefore is the easiest to understand.
- to complete it, go through each line, and complete the action.
Decision structure
- uses IF statements, meaning some actions can be ignored IF the following condition is true or not
- to complete it, you would need to know if the condition is true or not, to know whether to ignore certain steps
Case structure
- a form of decision structure where the cases are mutually exclusive, these use ELSEIF
Iteration
- Blocks of statements that are repeated until they are complete
Example of Structured English, to find an average of 5 numbers.
INPUT 5 numbers
ADD the 5 numbers together
DIVIDE the new number by 5
OUTPUT the final number
Source and more info at https://www.w3computing.com/systemsanalysis/writing-structured-english/
an Application
- chess bots - these use algorithms to take the current positions, and finds each move, and their win rate %, found in a large database called the NNUE, it takes the few most promising moves, and then uses an advanced neural network (basically a computer system build like our brains) to pick out its move, predicting what the player is going to do next and finding what leads to victory
- this uses many very complicated sub-routines, but very simply, above those, it is an algorithm to get position, find the best move, and then do it
mini test
- an algorithm is a finite set of instructions to complete a task
- an advantage, is they can then be coded into any language, as they are simple to read. a disadvantage, is that they can be time consuming to write out
- algorithms can be represented as psuedocode, or a flowchart
- language independent means that algorithms are not specific to any coding language, and can be easily read by anyone
- an application of an algorithm is a simple calculator
Comments
Post a Comment