You know the rules and so do I
Actually you don’t (except you read it before).
- Code should increment variable. If we have
a = 0
, next iteration should return 1, after that — 2, 3, 4… - You can (and need to) describe WHY it works like this. There is no magic — only algorithms.
- It should be weird/strange/etc. Just imagine normal code with your example. If you wanna throw your PC/laptop/tablet in window — you are doing great!
- It shouldn’t be boring.
a=a+1000-999
is definitely boring. - Increment should be written in one line (maybe it will be changed later).
- No imports for your code. It should be pure JS.
- The easiest way to test if it works — browser console.
- Supposed every code has string like
a = 0
in the beginning. It’s a good idea to put it in code.- The variable name by default is ‘a’. You can use a different name for styling purposes.