• Guest, To prevent spam, the BrokenLens Forums are not accepting new registrations at this time.

Multiplication

i'm interested in what you implemented to get this result lol

Basically what I programmed initially was simply to output the number of times the loop ran multiplied by the number of times the loop ran + 1 as I thought Bopl was asking to do that. I programmed that in four lines of python although I likely could have done it more efficiently if I didn't rush myself.
Here is that program:
upload_2020-11-30_15-54-48.png


However what I didn't realize when skimming through Bopl's post is that he mentioned that the end result should be multiplied by the end result + 1 instead of the number of times the loop ran. So like the second comment would be 2 * 3 = 6 and the third comment would be 6 * 7 = 42 instead of 3 * 4 = 12
As a result, I fixed my code to meet that requirement pretty quickly and due to the exponential nature of how that function would work, The numbers get too large to process after just 23 loops.
Here is that code here:
upload_2020-11-30_15-57-29.png


Hopefully this response sufficiently answers your question.
View reply.
 
Ahh right, I also assumed what you first thought he wanted so I was confused myself haha

Also codepen.io is pretty useful to share and edit others' code in real-time
https://codeshare.io/5we0gD

I also want to get into C so I can learn more about memory management, just so I understand the more lower-level intricacies of programming :D
View reply.
 
That’s cool!
My main focus is Java right now, I have started programming last year and doing some projects whenever I have time.
Right now I trying to develop a program which creates a food plan for me taking my weight (current and goal), height, age etc. into consideration, since I enjoy going to gym.
I heard that python is very similar to Java, but never really looked into it
kind of interested in seeing the source code because I do some java development too :o
i do enjoy seeing fellow coders like u and mr slicer
View reply.
 

Users Who Are Viewing This Thread (Total: 0, Members: 0, Guests: 0)

Back
Top