User:Pee/Sandbox
Advanced uses
Ignoring the limitation that there can only be a predefined maximum number of aliases, the alias
command alone makes the console Turing-complete. In other words, it is able to simulate any computer calculation, meaning a command can be run based on an arbitrarily complex way that aliased commands were invoked. For example, an alias can run another command if the amount of times the alias was invoked previously was prime. There are many uses that are more practical.
If the limit of a predefined maximum number of aliases is not ignored, the console is only able to simulate a finite-state machine. However, due to how the alias
command can simulate a finite-state machine, it negates the typical drawback of mathematical operations requiring extremely large quantities of states. This is because unlike a traditional finite-state machine, the results of inputs (contents of aliases) are not changed by default upon a transition. The following example helps illustrate this:
Here, after state A is activated, followed by input 1 firing, the functions of inputs 1 and 2 persist after state B becomes the current state. This attribute of inputs that may be defined independent of each other creates the possibility of encoding values in binary.
Compare the Source engine's ability to store a 32-bit value with 32 independent binary values to a traditional finite-state machine's requirement of 232 states to store an equivalent value.