The Riemann Sum!
LizFoster (648)

Let's talk about the Riemann Sum!!

Okay, so the Riemann Sum does the same thing that an integral does, as it is essentially measuring the area under a curve! What this means for 𝛑, is that you can measure the area (well, approximate the are) of a semicircle, multiply it by 2 to get the area of a circle, and divide by r**2, to solve for an approximate value of 𝛑!

To imagine the Riemann Sum properly, think of a semicircle, with both ends touching the x axis. Now, imagine this:

This is a good visualization of integration (or more specifically, the Riemann Sum), but what is actually going on?

Well, there are two ways to explain this: The Calculus way, or the Summation way.

First off, the Calculus method is fairly concise and easy to read, but does not really help all that much:

Cool, right? (Note from after I took that photo, the integration is not approximately the area, it is exactly the area.)

Now, the Summation way (aka the Riemann Sum) makes all this so much clearer!

(In case you do not know how to read this one, it is basically saying that, as n → ∞, it sums all of the areas of all n rectangles that fit under the curve.)

Note that, when plugged into a calculator, you can say:

Please let me know if you have any further questions!!!
^ ^*

Oh, also, please pardon my poor penmanship.. T ~ T I have not written English too much lately. (Lol)

You are viewing a single comment. View All
AmazingMech2418 (1039)

@LizFoster Well, for the type effectiveness part, you could probably just use a list or dictionary with values for the effectiveness and use those values to determine the damage per attack (or whatever is needed in Pokemon. I'm not really sure).

For the "bag" or inventory, you should be able to do a dictionary with all of the different items and their quantities and, when an object is picked up, increase the quantity by 1, and when an object is used/discarded, decrease it by 1. If there is a finite size, you could do that you can't pick up an object if the sum of all of the quantities is greater than a certain value, or the sum of the products of the quantities and a separate variable to determine the amount of space it would take up.

Then, for the turn-based fighting system, I'm still not completely sure what you need help with (the AI, the player, the overall UI?).

I hope this helps!