2 Replies - 567 Views - Last Post: 27 August 2012 - 02:39 PM Rate Topic: -----

#1 TonyD711  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 27-August 12

I'm Trying To Help A Friend With A Coding Issue.

Posted 27 August 2012 - 02:29 PM

I'm a Novice , so bare with me , I apologize in advance....A friend has developed a game and is have a problem setting it up to where items can be purchased 100 at a time....This is what he messaged me trying to explain the problem to me.



"When we buy one the increase is the same every time but when you buy 10 you buy them all at the same price....So if we had it buy 100 it would buy at the same price and that's no good.... Needs to calc the cost for 10 then subtract the cash.
recalc the new 10 price n subtract the cash
recalc the new 10 price n subtract the cash
recalc the new 10 price n subtract the cash
recalc the new 10 price n subtract the cash
n so on....A loop can be coded fairly easily but im trying to reduce code runtime, memory usage, and possible glitching."


Any help that could be provided would be Greatly Appreciated.

Is This A Good Question/Topic? 0
  • +

Replies To: I'm Trying To Help A Friend With A Coding Issue.

#2 GunnerInc  Icon User is offline

  • "Hurry up and wait"
  • member icon




Reputation: 858
  • View blog
  • Posts: 2,277
  • Joined: 28-March 11

Re: I'm Trying To Help A Friend With A Coding Issue.

Posted 27 August 2012 - 02:32 PM

The Introduce yourself forum is for well, Introducing yourself to us NOT coding questions... moving....

What code has "your friend" tried?
Was This Post Helpful? 0
  • +
  • -

#3 jon.kiparsky  Icon User is online

  • Pancakes!
  • member icon


Reputation: 7576
  • View blog
  • Posts: 12,729
  • Joined: 19-March 11

Re: I'm Trying To Help A Friend With A Coding Issue.

Posted 27 August 2012 - 02:39 PM

The best advice I could give your friend would be to learn to communicate effectively. That's some pretty obfuscated instructions.

However, if what's wanted is a bulk discount, it's probably easiest if you bear in mind that multiplication can often substitute for repeated addition.
Was This Post Helpful? 3
  • +
  • -

Page 1 of 1