fix: basic js rpg spacing and tests
Replaced tabs with spaces so spacing is consistent in the monaco editor. Also adjust some tests to account for the new loop protection.
This commit is contained in:
committed by
Mrugesh Mohapatra
parent
39b0afd5f0
commit
b99d78858b
@@ -35,7 +35,7 @@ while(i < 5) {
|
||||
```yml
|
||||
tests:
|
||||
- text: See description above for instructions.
|
||||
testString: assert(pick.toString().replace(/\s/g, '').includes('var_LP=Date.now();while(numbers.length<10){if(Date.now()-_LP>100)break;}')); # Take loop protect into account
|
||||
testString: assert(pick.toString().replace(/\s/g, '').includes('while(numbers.length<10){if(Date.now()-_LP>100){')); # Take loop protect into account
|
||||
|
||||
```
|
||||
|
||||
|
@@ -23,7 +23,7 @@ Inside the `while` loop, push a random number between 0 and 10 onto the end of t
|
||||
```yml
|
||||
tests:
|
||||
- text: See description above for instructions.
|
||||
testString: assert(pick.toString().replace(/\s/g, '').includes('while(numbers.length<10){if(Date.now()-_LP>100)break;numbers.push(Math.floor(Math.random()*11));}')); # Take loop protect into account
|
||||
testString: assert(pick.toString().replace(/\s/g, '').includes('numbers.push(Math.floor(Math.random()*11));}')); # Take loop protect into account
|
||||
|
||||
```
|
||||
|
||||
|
@@ -31,7 +31,7 @@ for (let x = 1; x < 5; x++) {
|
||||
```yml
|
||||
tests:
|
||||
- text: See description above for instructions.
|
||||
testString: assert(pick.toString().replace(/\s/g, '').includes('for(varx=1;x<5;x++){if(Date.now()-_LP2>100)break;}')); # Also test for automatic loop protection
|
||||
testString: assert(pick.toString().replace(/\s/g, '').includes('for(varx=1;x<5;x++){')); # Also test for automatic loop protection
|
||||
|
||||
```
|
||||
|
||||
|
@@ -27,7 +27,7 @@ Many `for` loops use `i` as an initializer and start from 0, so change `let x =
|
||||
```yml
|
||||
tests:
|
||||
- text: See description above for instructions.
|
||||
testString: assert(pick.toString().replace(/\s/g, '').includes('for(vari=0;x<5;x++){if(Date.now()-_LP2>100)break;}')); # Also test for automatic loop protection
|
||||
testString: assert(pick.toString().replace(/\s/g, '').includes('for(vari=0;x<5;x++){')); # Also test for automatic loop protection
|
||||
|
||||
```
|
||||
|
||||
|
@@ -25,7 +25,7 @@ We want the loop to run 10 times, so change `x < 5` to `i < 10`.
|
||||
```yml
|
||||
tests:
|
||||
- text: See description above for instructions.
|
||||
testString: assert(pick.toString().replace(/\s/g, '').includes('for(vari=0;i<10;x++){if(Date.now()-_LP2>100)break;}')); # Also test for automatic loop protection
|
||||
testString: assert(pick.toString().replace(/\s/g, '').includes('for(vari=0;i<10;x++){')); # Also test for automatic loop protection
|
||||
|
||||
```
|
||||
|
||||
|
@@ -25,7 +25,7 @@ Since we changed the initializer from `x` to `i`, change `x++` to `i++`. This wi
|
||||
```yml
|
||||
tests:
|
||||
- text: See description above for instructions.
|
||||
testString: assert(pick.toString().replace(/\s/g, '').includes('for(vari=0;i<10;i++){if(Date.now()-_LP2>100)break;}')); # Also test for automatic loop protection
|
||||
testString: assert(pick.toString().replace(/\s/g, '').includes('for(vari=0;i<10;i++){')); # Also test for automatic loop protection
|
||||
|
||||
```
|
||||
|
||||
|
@@ -23,7 +23,7 @@ Inside the for loop, use the `+=` operator to add to the end of `text.innerText`
|
||||
```yml
|
||||
tests:
|
||||
- text: See description above for instructions.
|
||||
testString: assert( pick.toString().replace(/\s/g, '').includes('for(vari=0;i<10;i++){if(Date.now()-_LP2>100)break;text.innerText+=numbers[i]+"\\n";}') || pick.toString().replace(/\s/g, '').includes('for(vari=0;i<10;i++){if(Date.now()-_LP2>100)break;text.innerText+="".concat(numbers[i],"\\n");}') ); # Also test for automatic loop protection
|
||||
testString: assert( pick.toString().replace(/\s/g, '').includes('text.innerText+=numbers[i]+"\\n";}}') ); # Also test for automatic loop protection
|
||||
|
||||
```
|
||||
|
||||
|
Reference in New Issue
Block a user