Programming Puzzles and Code Golf has graduated from beta. Soon we will get a custom site design, and with that the reputation boundaries for privileges will go up. A lot of users will lose privileges on the site. So your task is to write a program that tells us how much extra reputation we'll need to keep our privileges.
Task
Your task is to write the shortest code to find the amount of extra reputation a user will need to keep their current privileges after the site design, given the number of reputation points.
Input / Output
You can accept input and give output in any way you like, so long as it follows these rules:
Input - An integer from 1 to 250000+ inclusive. Your program or function should be able to accept numbers bigger than this, but it must accept numbers in this range.
Output - An integer representing the number of reputation points the user will need to get to keep their current privileges after the graduation.
No standard loopholes, please.
Example algorithm
- Set variable
i
to the input - Set variable
r
to variablei
. - While
r
is not in listbeta
:- Subtract
1
fromr
.
- Subtract
- Set
n
to the position ofr
inbeta
. - Set
r
to itemn
ofgraduated
. - Set variable
o
to the result ofr
-
i
. - If
o
<
0
:- Set variable
o
to0
.
- Set variable
- Output variable
o
.
Tables
Table of privileges that will change
| privilege name | beta rep | graduation rep |
-+-----------------------------+----------+----------------+-
| create tags | 150 | 1500 |
| access review queues | 350 | 500 |
| cast close and reopen votes | 500 | 3000 |
| established user | 750 | 1000 |
| edit questions and answers | 1000 | 2000 |
| create tag synonyms | 1250 | 2500 |
| approve tag wiki edits | 1500 | 5000 |
| access to moderator tools | 2000 | 10000 |
| protect questions | 3500 | 15000 |
| trusted user | 4000 | 20000 |
| access to site analytics | 5000 | 25000 |
-+-----------------------------+----------+----------------+-
| privilege name | beta rep | graduation rep |
Table of privileges that won't change
| privilege name | reputation |
-+------------------------------+------------+-
| create posts | 1 |
| participate in meta | 1 |
| create wiki posts | 10 |
| remove new user restrictions | 10 |
| vote up | 15 |
| flag posts | 15 |
| talk in chat | 20 |
| comment everywhere | 50 |
| set bounties | 75 |
| create chatrooms | 100 |
| edit community wiki | 100 |
| vote down | 125 |
-+------------------------------+------------+-
| privilege name | reputation |
Testcases
wizzwizz4 | 750 | 2250
cat | 2004 | 7996
Dennis ♦ | 72950 | 0
Dr Green Eggs and Ham DJ | 4683 | 15317
New User | 1 | 0
Not all reputation counts are correct at time of writing
If you want your past or present reputation count here, just comment below and I'll maybe add it.