newplumber
Senior Member
Not to add a garbage post but I was testing a different way of coding
of course it wouldn't be much use for you pros but since i figured
adding a ' key doesn't lengthen the code so why not use alot of them
I am probably behind times on this ... but it was a hard question to crack for me
of course it wouldn't be much use for you pros but since i figured
adding a ' key doesn't lengthen the code so why not use alot of them
Code:
'any PE simulator or picaxe chip
symbol frank = b2
symbol fred = b3
symbol fritz = b4
symbol Abby = b5
symbol motel = b6
symbol each_owe = b7
symbol real_paid = b8
start:
frank = 20 'each has a twenty dollar bill
fred = 20 'each has a twenty dollar bill
fritz = 20 'each has a twenty dollar bill
'frank,fred and fritz went hunting one day and got lost
'after many hours walking they came across a town with a motel
'when reached the motel which they planned to stay for one night
'the front desk lady Abby said it was 30 dollars a night for 3 beds
' so how much did each guy pay ?
each_owe = 30 / 3 ' ten dollars each
frank = frank - each_owe
fred = fred - each_owe
fritz = fritz - each_owe
'then after they went to the room, the manager said I might know those
'guys so he told Abby to only charge 25 dollars for the night and bring back
'the change divided to each of them. As Abby was walking to the room
'she could not divide 5 ones into 3 ways so she keeped two and
'gave each a dollar back
Abby = 2
frank = frank + 1
fred = fred + 1
fritz = fritz + 1
'so how much did the 3 guys really pay
real_paid = frank+fred+fritz
real_paid = 60 - real_paid
sertxd (#real_paid," amount of dollars the 3 guys paid",cr)
pause 2000
sertxd ("so ",#real_paid," dollars + the ",#Abby," Abby kepted = 29!..wheres the other dollar?",cr)
pause 4000
end