in list problem... in Developer Help
|
|
Code:
Volume() input("What do you want to find the volume of?","Volume")in list("Cube","Rectangle","Circle") if("Cube") usr << "<font color = green>What is the length of one side?(All sides must be equal to be a cube!)" var/a = input("Length of side","Lenght")as num var/b = a*a*a usr << "<font color = green>The volume of the cube is [b]!" if("Rectangle") usr << "<font color = green><img src = http://www.math.com/tables/geometry/rprism.gif>What is the length of side C?" if("Circle") return
|
Problem description:
Well, no matter what I pick in the list, it always does the Cube...
|
What you're doing is only suitable in a switch() situation.
like this.
switch(input("What do you want to find the volume of?","Volume")in list("Cube","Rectangle","Circle"))if("Cube")
usr << "<font color = green>What is the length of one side?(All sides must be equal to be a cube!)"
var/a = input("Length of side","Lenght")as num
var/b = a*a*a
usr << "<font color = green>The volume of the cube is [b]!"
if("Rectangle")
usr << "<font color = green><img src = http://www.math.com/tables/geometry/rprism.gif>What is the length of side C?"
if("Circle")
return
</DM>
if not you have to do this ( not recommended unless necessary)
var/A=input("What do you want to find the volume of?","Volume")in list("Cube","Rectangle","Circle")if(A=="Cube")
usr << "<font color = green>What is the length of one side?(All sides must be equal to be a cube!)"
var/a = input("Length of side","Lenght")as num
var/b = a*a*a
usr << "<font color = green>The volume of the cube is [b]!"
if(A=="Rectangle")
usr << "<font color = green><img src = http://www.math.com/tables/geometry/rprism.gif>What is the length of side C?"
if(A=="Circle")
return