vending machine
Author |
Message |
Jenkinz
|
Posted: Tue Mar 28, 2006 9:02 am Post subject: vending machine |
|
|
I've tried to get this vending machine to work correctly and it seems that everything is, the only thing wrong with it is that the pictures won show, if anyone can see why help would be appreciated greatly
var letter :string
var number :int
var answer :string
loop
put "Please enter the letter selection"
get letter
put "Please enter the number selection"
get number
if number= 1 and letter = "A" then
Pic.ScreenLoad("crispycrunch.bmp", 100, 100, picCopy)
elsif number= 1 and letter = "B" then
Pic.ScreenLoad("mmpeanut.bmp", 100, 100, picCopy)
elsif number= 1 and letter = "C" then
Pic.ScreenLoad("max5.bmp", 100, 100, picCopy)
elsif number= 1 and letter = "D" then
Pic.ScreenLoad("snickers.bmp", 100, 100, picCopy)
elsif number= 1 and letter = "E" then
Pic.ScreenLoad("smarties.bmp", 100, 100, picCopy)
elsif number= 1 and letter = "F" then
Pic.ScreenLoad("MarsBar.bmp", 100, 100, picCopy)
elsif number=1 and letter = "G" then
Pic.ScreenLoad("CoffeeCrisp.bmp", 100, 100, picCopy)
elsif number=1 and letter = "H" then
Pic.ScreenLoad("aero.bmp", 100, 100, picCopy)
end if
delay (1000)
put "do you want another poster?"
get answer
exit when answer = "no"
end loop |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
codemage
![](http://usera.imagecave.com/codemage/codemage-small.gif)
|
Posted: Tue Mar 28, 2006 9:56 am Post subject: (No subject) |
|
|
For starters, make sure that your .t file and all of your images are saved in the same location. |
|
|
|
|
![](images/spacer.gif) |
Delos
![](http://www.members.shaw.ca/rfolz/delos_avatar.gif)
|
Posted: Tue Mar 28, 2006 10:46 am Post subject: (No subject) |
|
|
Hello Jenkinz. Please use [code] tags in the future when posting code. |
|
|
|
|
![](images/spacer.gif) |
Jenkinz
|
Posted: Tue Mar 28, 2006 1:09 pm Post subject: (No subject) |
|
|
Delos wrote: Hello Jenkinz. Please use [code] tags in the future when posting code.
sorry bout that, and yes all my images are saved as bmp and are in the same folder as the actual question |
|
|
|
|
![](images/spacer.gif) |
Dan
![](http://wiki.compsci.ca/images/archive/3/3c/20100325043407!Danspic.gif)
|
Posted: Tue Mar 28, 2006 1:39 pm Post subject: (No subject) |
|
|
Are you puting the letter in as a captial becuses the way you have it lowercase will not work. Also you could do this much easyer by naming the image files the same as there letter number code and then adding the number to the string and puting that in Pic.ScreenLoad + the file existion.
Any how there are no syntax errors in your code, so either you are not using a captial letter or there is somthing wrong with the images. |
Computer Science Canada
Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more! |
|
|
|
![](images/spacer.gif) |
|
|