3 improved golf score
source | link

VBScript, 204 234 234232 characters

edit(edit: forgot the "unknown" partimproved score by 2 by using array() instead of split(). 232 now.)

f=failsafe:for b=0to 3:s=s&split(",; Detection zones staying in a given state,; Bad visibility,,; Initialization,,,,; Bad configuration",",")(f and 2^b):next:splitarray("No technical alarmsalarms",Unknown"Unknown","&midmid(s,3),",")(2+(f=0)+(len(s)=0))

(edit: forgot the "unknown" part. 234 chars now.)

f=failsafe:for b=0to 3:s=s&split(",; Detection zones staying in a given state,; Bad visibility,,; Initialization,,,,; Bad configuration",",")(f and 2^b):next:split("No technical alarms,Unknown,"&mid(s,3),",")(2+(f=0)+(len(s)=0))

(original, 230)

for b=0to 3:s=s&split(",; Detection zones staying in a given state,; Bad visibility,,; Initialization,,,,; Bad configuration",",")(FailSafe and 2^b):next:array(mid(s,3),"No technical alarms")(-(len(s)=0))

Of course, this is just part of a script. to test it, try something like this:

FailSafe=cint(inputbox("Please enter Failsafe as an integer"))
f=failsafe:for b=0to 3:s=s&split(",; Detection zones staying in a given state,; Bad visibility,,; Initialization,,,,; Bad configuration",",")(f and 2^b):next
msgbox splitarray("No technical alarmsalarms",Unknown"Unknown","&midmid(s,3),",")(2+(f=0)+(len(s)=0))

VBScript, 204 234 characters

edit: forgot the "unknown" part

f=failsafe:for b=0to 3:s=s&split(",; Detection zones staying in a given state,; Bad visibility,,; Initialization,,,,; Bad configuration",",")(f and 2^b):next:split("No technical alarms,Unknown,"&mid(s,3),",")(2+(f=0)+(len(s)=0))

for b=0to 3:s=s&split(",; Detection zones staying in a given state,; Bad visibility,,; Initialization,,,,; Bad configuration",",")(FailSafe and 2^b):next:array(mid(s,3),"No technical alarms")(-(len(s)=0))

Of course, this is just part of a script. to test it, try something like this:

FailSafe=cint(inputbox("Please enter Failsafe as an integer"))
f=failsafe:for b=0to 3:s=s&split(",; Detection zones staying in a given state,; Bad visibility,,; Initialization,,,,; Bad configuration",",")(f and 2^b):next
msgbox split("No technical alarms,Unknown,"&mid(s,3),",")(2+(f=0)+(len(s)=0))

VBScript, 204 234 232 characters

(edit: improved score by 2 by using array() instead of split(). 232 now.)

f=failsafe:for b=0to 3:s=s&split(",; Detection zones staying in a given state,; Bad visibility,,; Initialization,,,,; Bad configuration",",")(f and 2^b):next:array("No technical alarms","Unknown",mid(s,3))(2+(f=0)+(len(s)=0))

(edit: forgot the "unknown" part. 234 chars now.)

f=failsafe:for b=0to 3:s=s&split(",; Detection zones staying in a given state,; Bad visibility,,; Initialization,,,,; Bad configuration",",")(f and 2^b):next:split("No technical alarms,Unknown,"&mid(s,3),",")(2+(f=0)+(len(s)=0))

(original, 230)

for b=0to 3:s=s&split(",; Detection zones staying in a given state,; Bad visibility,,; Initialization,,,,; Bad configuration",",")(FailSafe and 2^b):next:array(mid(s,3),"No technical alarms")(-(len(s)=0))

Of course, this is just part of a script. to test it, try something like this:

FailSafe=cint(inputbox("Please enter Failsafe as an integer"))
f=failsafe:for b=0to 3:s=s&split(",; Detection zones staying in a given state,; Bad visibility,,; Initialization,,,,; Bad configuration",",")(f and 2^b):next
msgbox array("No technical alarms","Unknown",mid(s,3))(2+(f=0)+(len(s)=0))
2 corrected answer
source | link

VBScript, 204204 234 characters

edit: forgot the "unknown" part

f=failsafe:for b=0to 3:s=s&split(",; Detection zones staying in a given state,; Bad visibility,,; Initialization,,,,; Bad configuration",",")(FailSafef and 2^b):next:arraysplit(mid"No technical alarms,Unknown,"&mid(s,3),"No technical alarms"",")(-2+(f=0)+(len(s)=0))

for b=0to 3:s=s&split(",; Detection zones staying in a given state,; Bad visibility,,; Initialization,,,,; Bad configuration",",")(FailSafe and 2^b):next:array(mid(s,3),"No technical alarms")(-(len(s)=0))

Of course, this is just part of a script. to test it, try something like this:

FailSafe=cint(inputbox("Please enter Failsafe as an integer"))
f=failsafe:for b=0to 3:s=s&split(",; Detection zones staying in a given state,; Bad visibility,,; Initialization,,,,; Bad configuration",",")(FailSafef and 2^b):next
str=arraymsgbox split(mid"No technical alarms,Unknown,"&mid(s,3),"No technical alarms"",")(-2+(f=0)+(len(s)=0))
msgbox str

VBScript, 204 characters

for b=0to 3:s=s&split(",; Detection zones staying in a given state,; Bad visibility,,; Initialization,,,,; Bad configuration",",")(FailSafe and 2^b):next:array(mid(s,3),"No technical alarms")(-(len(s)=0))

Of course, this is just part of a script. to test it, try something like this:

FailSafe=cint(inputbox("Please enter Failsafe as an integer"))
for b=0to 3:s=s&split(",; Detection zones staying in a given state,; Bad visibility,,; Initialization,,,,; Bad configuration",",")(FailSafe and 2^b):next
str=array(mid(s,3),"No technical alarms")(-(len(s)=0))
msgbox str

VBScript, 204 234 characters

edit: forgot the "unknown" part

f=failsafe:for b=0to 3:s=s&split(",; Detection zones staying in a given state,; Bad visibility,,; Initialization,,,,; Bad configuration",",")(f and 2^b):next:split("No technical alarms,Unknown,"&mid(s,3),",")(2+(f=0)+(len(s)=0))

for b=0to 3:s=s&split(",; Detection zones staying in a given state,; Bad visibility,,; Initialization,,,,; Bad configuration",",")(FailSafe and 2^b):next:array(mid(s,3),"No technical alarms")(-(len(s)=0))

Of course, this is just part of a script. to test it, try something like this:

FailSafe=cint(inputbox("Please enter Failsafe as an integer"))
f=failsafe:for b=0to 3:s=s&split(",; Detection zones staying in a given state,; Bad visibility,,; Initialization,,,,; Bad configuration",",")(f and 2^b):next
msgbox split("No technical alarms,Unknown,"&mid(s,3),",")(2+(f=0)+(len(s)=0))
1
source | link

VBScript, 204 characters

for b=0to 3:s=s&split(",; Detection zones staying in a given state,; Bad visibility,,; Initialization,,,,; Bad configuration",",")(FailSafe and 2^b):next:array(mid(s,3),"No technical alarms")(-(len(s)=0))

Of course, this is just part of a script. to test it, try something like this:

FailSafe=cint(inputbox("Please enter Failsafe as an integer"))
for b=0to 3:s=s&split(",; Detection zones staying in a given state,; Bad visibility,,; Initialization,,,,; Bad configuration",",")(FailSafe and 2^b):next
str=array(mid(s,3),"No technical alarms")(-(len(s)=0))
msgbox str