程序在显示变量F#之前突然关闭(输入< - Console.ReadLine()|> int)行

时间:2017-12-12 13:57:52

标签: f#

只是发生错误的函数的快速片段

find . -name '*.js'|xargs  sed -i '/FormGroupDirective/,/emitEvent: false/ {s/cleanUpControl(dir._control, dir);/cleanUpControl(dir._control, dir,_this);/;s/setUpControl(newCtrl, dir);/setUpControl(newCtrl, dir,_this);/; s/dir._control = null;/dir._control = _this;/ }'

该程序打印前3个printf语句,但似乎停在

let fightmon(a: Monster) (b: User) = 
    let textoftype = showtype a.dType
    let mmaxhealth = a.hVal
    let mutable mhealth = a.hVal
    let mutable mdam = a.dVal
    let mutable mtype = a.dType
    let mutable uhealth = b.hVal
    let mutable uarm = b.Arm.aVal
    let mutable udam = b.Weap.dVal
    let mutable utype = b.Arm.dType
    printf "The %s appears infront of you, seems to be a %s type \n " a.name textoftype
    printf "%s" a.info
    while mhealth>0.9 || uhealth>0.9 do
        let mutable input =0
        while input <> 1 || input<> 2 do
            printf "Attack with 1, enter inventory with 2 "
            input <- Console.ReadLine() |>int
            printf "input read"
            if input<>1 || input<>2 then 
                printf "The option you selected is not applicable \n"
在提供类似输出之前

input<- Console.ReadLine() |>int

这段代码或其他地方是否存在问题,因为这也发生在我使用输入&lt; -Console.Readline()|&gt; int line

的其他函数中

0 个答案:

没有答案