ID:145724
 
Code:
var/list/Choices=list("Rock","Paper","Scissors")

mob/verb/Challenge_AI()
var/AI = pick(Choices)
if(usr.playing == 1)
usr << "Your currently in the middle of a game"
return
else
if(usr.playing != 1)
usr.playing = 1
switch(alert(usr,"Rock, Paper, or Scissors?","Menu","Rock","Paper","Scissors"))
if("Rock")
usr.Picked = "Rock"
if("Paper")
usr.Picked = "Paper"
if("Scissors")
usr.Picked = "Scissors"
if(usr.Picked == AI)
usr << "Draw"
else
if(usr.Picked == "Rock"||AI == "Scissors")
usr << "You win!"
if(usr.Picked == "Scissors"||AI == "Rock")
usr << "You loose.."
else
if(usr.Picked == "Paper"||AI == "Rock")
usr << "You win!"
if(usr.Picked == "Rock"||AI == "Paper")
usr << "You loose.."
else
if(usr.Picked == "Scissors"||AI == "Paper")
usr << "You win!"
if(usr.Picked == "Paper"||AI == "Scissors")
usr << "You loose.."
usr.playing = 0


Problem description: You never loose, and hardly ever draw, I need it to be a full working AI system, with the AI's choice more random.

Shouldn't theese be..
                if(usr.Picked == "Rock"&&AI == "Scissors")
usr << "You win!"
if(usr.Picked == "Scissors"&&AI == "Rock")
usr << "You loose.."
else
if(usr.Picked == "Paper"&&AI == "Rock")
usr << "You win!"
if(usr.Picked == "Rock"&&AI == "Paper")
usr << "You loose.."
else
if(usr.Picked == "Scissors"&&AI == "Paper")
usr << "You win!"
if(usr.Picked == "Paper"&&AI == "Scissors")
usr << "You loose.."


[EDIT: Also, don't you think the AI should have more skill? Look and see what the opponet uses the often, and judge upon that.]
//edit after kija's reccomendation
var/list/Choices=list("Rock"="Paper","Paper"="Scissors","Scissors"="Rock")
mob
verb/Challenge_AI()
if(!playing)
playing=1
var
AI=pick(Choices)
Picked=alert("Rock, Paper, or Scissors?","Menu","Rock","Paper","Scissors")
if(Picked==AI) src<<"The round has come to a draw. You both picked [Picked]."
else
if(Choices["[Picked]"]==AI) usr<<"The round has ended. The AI has won with [AI] versus your [Picked]."
else src<<"The round has ended. You have beaten the AI with [Picked] versus its [AI]."
playing=0
var/playing

Wee.
If you are going to use the variable Picked for the alert proc, then you could just do:
Picked=alert()

In response to Flame Sage
I would add some sort of a system where the AI looked at the last choice or few choices and then based its choice upon data previously taken. For example if the person repetitively chose Rock, the AI could have some sort of percentage and go by that... or something. I think you get my point. It could also check for patterns.