So I'm building a mobile game where I have simple XP progression system that goes like this: Level1: 0-399 Total XP Level2: 400-1199 Total XP Level3: 1200-2399 Total XP So basically for the first level the player needs 400 XP to level up. Once it reaches that the exp bar goes to zero and then needs 800 XP to level up, the XP bar goes to 0 and needs 1200 and so on. I was wondering if there is a formula in order to calculate the current level of the player and the current experience (i.e. 400/800 when it has 800 total XP) from the Total XP. EDIT: So I found the formula Level = Floor(1/20 (10 + sqrt(2) sqrt(50 + TOTAL XP))) but I still can't figure out the formula to find the Current XP Thank you
In my game, XP needed to reach the next level is Current Level × Level Threshold.  Given that, how can I get my current level from the total XP ever earned?    For example:  Level Threshold = 50 Current Level = 1   Starting at level 1, I would need (1 × 50) = 50 XP to get to level 2, and so on.  Level 1: 50 XP needed to reach level 2 Level 2: 100 more XP needed to reach level 3 Level 3: 150 more XP needed to reach level 4   In other words, the progression table is as follows:  Level 1: 0 XP to 49 XP Level 2: 50 XP to 149 XP  Level 3: 150 XP to 299 XP Level 4: 300 XP to 499 XP   If I have 300 XP, I'll just reached level 4. How can I calculate that generally?
How to show that $L^p$ spaces are nested? Suppose $1&lt;p_1&lt;p_2&lt;\infty$, then show $L^{p_1}[a,b] \supset L^{p_2}[a,b]$.  I was able to show $\|f\|_{p_1} \le \|f\|_{p_2} (b-a)^{1/p_1 - 1/p_2}$ but I'm not sure how to proceed from here. What is your favorite method to handle errors in Bash?  The best example of handling errors I have found on the web was written by William Shotts, Jr at .   He suggests using the following function for error handling in Bash:  #!/bin/bash  # A slicker error handling routine  # I put a variable in my scripts named PROGNAME which # holds the name of the program being run.  You can get this # value from the first item on the command line ($0).  # Reference: This was copied from &lt;http://www.linuxcommand.org/wss0150.php&gt;  PROGNAME=$(basename $0)  function error_exit {  #   ---------------------------------------------------------------- #   Function for exit due to fatal program error #       Accepts 1 argument: #           string containing descriptive error message #   ----------------------------------------------------------------       echo "${PROGNAME}: ${1:-"Unknown Error"}" 1&gt;&amp;2     exit 1 }  # Example call of the error_exit function.  Note the inclusion # of the LINENO environment variable.  It contains the current # line number.  echo "Example of error with line number and message" error_exit "$LINENO: An error has occurred."   Do you have a better error handling routine that you use in Bash scripts? Is it possible to plot a graph of any shape? Mathematical notation around the world I am married to a UK citizen. What type of visa do I need to travel to the UK for tourism? I am a Bangladeshi citizen married with my husband who is a British citizen by birth. Currently, we both live in Bangladesh and my husband works at a university. We, are planning to visit UK for about 3 weeks. Just to be clear, we have no intention to settle down in the UK.  Do I need to apply for a visa? If so, then what type of visa should I apply for?  N.B. I've been searching on the internet (including the UK border agency website) for hours now but couldn't get a definite answer. Splitting string into pair of characters in Ruby I have a string (e.g. "AABBCCDDEEFF") and want to split this into an array with each element containing two characters - ["AA", "BB", "CC", "DD", "EE", "FF"]. Does it look good to edit the question you're answering? I have a question about editing practices:  Does it look good to edit a question you have just answered?  For example: say I had just answered a question, then saw that the question had some minor formatting issues. Should I edit it? Does it turn up voters off when they see that I am answering a question I changed, possibly to better suit my answer? Open local folder from link I have an issue with my website: Google isn’t using my meta description, instead it’s using the content of the web page and I’m really confused.  Reason I’m confused is because I have checked and I don’t have duplicate page titles, description nor keywords, neither do I have any robots.txt for my website. My page title, description and keyword is unique, and page description is about 150 characters.  I have my site in Google Webmaster Tools and I checked for errors, but found none.  So I really don’t know why Google Search isn’t using my meta description. What is the shortcut for opening a new window (opening folders). for that I have to go to folder options and right click and then need to click on open new window.  or I have to make focus on the folder icon or open a folder then press  Ctrl+N  for opening a new window is there any direct command spcific to open a new window in ubuntu. How do I determine whether a drive is an HDD or SSD in Windows 8? I've recently received an assembled PC. I don't know if the disk is an SSD or old HDD (whether SATA or other technologies).  I can't find a way to tell if the disk is SSD or not, apart from the size of the disk. However, now that the sizes of SSDs are getting close to that of HDDs, checking the size is not a good and robust way to distinguish drive type. Is there some other way to determine if the disk is an SSD? Taking the second derivative of a parametric curve Difference between Space Opera and Science Fiction? A while back a guy came into the place where I was working. He had a book (I don't remember the name). The book was, according to him, scifi. I told him, "Great! My favorite scifi is the Skylark Series by EE Doc Smith!" He sort of tsked this, saying, "Oh, that's only space opera." I really didn't know what to think of what he said. The funny thing was, I remembering looking at his book thinking, what makes his book scifi any more than mine.  I started thinking about this incident the other day and am once again curious:  What is the difference between space opera and science fiction? What identifies each genre specifically?    NOTE: I had originally asked this on meta due to the closed question:  which is very similar to my question. It was subsequently moved to the main site. Facebook: Ways to preserve image quality of uploaded images? Self-Contained Proof that $\sum\limits_{n=1}^{\infty} \frac1{n^p}$ Converges for $p > 1$ Looking for a 1000 most frequent english words Is there a free list of 1000 most frequent words used in everyday English? If there is a list with usage examples (as each of those words has multiple meanings for sure, not to cound phrasal verbs), it would be even greater.  Is there something alike, but with phrases? (E.g. 1000 most frequent phrases) automatically apply special formatting to selected words in text In windows we have an option to view recently opened media files as my recent documents, I was  wondering does there exists something like that in Ubuntu?  via terminal or via GUI? De Rham Cohomology of the tangent bundle of a manifold I would like to compute the de Rham cohomology of the tangent bundle $TM$ of a manifold $M$. It seems to me that we can just homotopy each fibre to a point, and that this would give a homotopy equivalence between $TM$ and $M$. Since de Rham cohomology is a homotopy invariant, this would imply that $H^*_{\text{dR}}(TM) \cong H^*_{\text{dR}}(M)$.     Is it always true that the tangent bundle of a manifold is homotopic to the manifold itself by the homotopy of each fibre with a point? Unable to upgrade pip