Advertisement
phicr

FF8 Quiz Algo

Mar 4th, 2023
1,147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 1.13 KB | None | 0 0
  1. Let S be an Integer (0 ≤ S ≤ 100)
  2. Let N be an Integer (0 ≤ N ≤ 10)
  3. Let I be an Integer (0 ≤ N ≤ 10)
  4. Let Answer be an Array of 10 × Yes|No
  5.  
  6. Take Test
  7. Answer All Yes
  8. Store Score into S
  9. Store 1 into N
  10. Store 10×Yes into Answer
  11. Until N > 10 or S = 100
  12.   Retake Test
  13.   For I from 1 to N-1 (inclusive)
  14.     Mark Option I as Answer[I]
  15.   End For
  16.   Mark Option N as No
  17.   Mark Option N+1 as No
  18.   For I from N+2 to 10 (inclusive)
  19.     Mark Option I as Yes
  20.   End For
  21.   If Score Is S + 20
  22.     Store No into Answer[N]
  23.     Store No into Answer[N+1]
  24.     Store S+20 into S
  25.   Else If Score Is S
  26.     Retake Test
  27.     For I from 1 to N-1 (inclusive)
  28.       Mark Option I as Answer[I]
  29.     End For
  30.     Mark Option N as No
  31.     For I from 1 to N+1 (inclusive)
  32.       Mark Option I as Yes
  33.     End For
  34.     If Score Is S + 10
  35.       Store No into Answer[N]
  36.     Else
  37.       Store No into Answer[N+1]
  38.     End If
  39.     Store S+10 into S
  40.   Else If Score Is S - 20
  41.     // Do Nothing (clarifying clause)
  42.   End If
  43.   Store N+2 into N
  44. End Until
  45.  
  46. If S < 100
  47.   Retake Test
  48.   For I in 1 to 10
  49.     Mark Option I as Answer[I]
  50.   End For
  51. End If
  52.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement