View Single Post
Old 28 March 2017, 23:34   #48
Jackoland
Registered User
 
Join Date: Jun 2014
Location: Leeds
Posts: 174
Hi there. Well I have managed to write some code from a little pseudo code I made. It works so far to the end. Here is the pseudo code.

Shop simulator

;Setup initial variables

Money= random between 500 - 1000 ;final figures to be finalised
Finalrent= 0
Reputation=0
Luck=0
Shop=0
Rent1= random between 50-100
Rent2= random between 120-170
Rent3=random between 150-220 ;final ranges to be confirmed
Username$



;introduction
Print "welcome to shop simulator, what is your name?"
Store input in username
Print "the bank will lend you" , money

Which shop would you like to buy?
1. Holds one product and costs (rent1) per month
2. Holds three products and costs (rent2) per month
3. Holds five products and costs (rent3) per month
Store input in shop variable (use edit command)

If shop equals 1 put rent1 into finalrent
If shop equals 2 put rent2 into finalrent
If shop equals 3 put rent3 into finalrent

Print "you chose shop (shop) and will pay £ (finalrent) per month"

Shopname =
What do you want to call your shop?
Store name in shopname

Print "welcome to (shopname) your shop is now open"

The help I need now is I need lots of products to choose from, it will have a name, cost, year and also the amount it will increase the shops reputation. Would I be best using an array to store these variables?

Then I need to create a loop that
Adds 1 to the day
Checks if it's less than 365
If more then add to year and reset day
Minus rent
Check if money is greater than 0 if not game over
Give opinion to buy from the array variables
Add that to a shop inventory and minus cost from money
Add reputation from product array variable
Check reputation score then add to a customer numbers
Check customers and add money made to money
Check luck
Random luck
If luck high give good news variable - need to create another array for good luck things such as tax return, rent cut etc
If luck low give bad news variable e.g. Flood in store, increase rent, electric bill.


You get the idea. I'm still working out how I would do this, and how to loop it.

Cheers
Rich

Ps think I would be better on new thread
Jackoland is offline  
 
Page generated in 0.04625 seconds with 11 queries