set %x to 1 set %level to the level the user inputs takeaway 1 set %xp to 0 while %x is smaller than %level set %tempxp calculate (%x plus 300 times 2 to the power of (%x devided by 7)) rounded to the floor, devided by four inc %xp with %tempxp inc %x return integer %xp)