def calc_bs(bs, mod): if mod == ("bad", "yes"): bs = bs - 10 return bs if mod == ("good", "yes"): bs = bs + 10 return bs if mod == ("double good", "yes"): bs = bs + 20 return bs if mod == ("double bad", "yes"): bs = bs - 20 return bs if mod == ("triple bad", "yes"): bs = bs - 30 return bs if mod == ("triple good", "yes"): bs = bs + 30 return bs else: return bs aim = "good", "no" aim_full = "double good", "no" semi_auto = "good", "no" full_auto = "double good", "no" supp_fire = "double bad", "no" enemy_ran = "double bad", "no" surprise = "triple good", "no" massive_target = "triple good", "no" point_blank = "triple good", "no" stunned = "double good", "no" enormous_target = "double good", "no" short_range = "good", "no" hulking_target = "good", "no" heavy_rain = "bad", "no" scrawny_target = "bad", "no" called_shot = "double bad", 'no' target_in_melee = "double bad", 'no' fog_mist = "double bad", 'no' puny_target = 'double bad', 'no' no_talent = "double bad", 'no' miniscule_target = "triple bad", "no" extreme_range = "triple bad", 'no' target_concealed = "triple bad", 'no' darkness = "triple bad", 'no' bs = 30 part1 = calc_bs(calc_bs(calc_bs(calc_bs(calc_bs(bs,aim),aim_full),semi_auto),full_auto),supp_fire) part2 = calc_bs(calc_bs(calc_bs(calc_bs(calc_bs(part1,enemy_ran),surprise),massive_target),point_blank),stunned) part3 = calc_bs(calc_bs(calc_bs(calc_bs(calc_bs(part2, enormous_target), short_range), hulking_target), heavy_rain), scrawny_target) part4 = calc_bs(calc_bs(calc_bs(calc_bs(calc_bs(part3, called_shot), target_in_melee), fog_mist), puny_target), no_talent) part5 = calc_bs(calc_bs(calc_bs(calc_bs(part4, miniscule_target), extreme_range), target_concealed), darkness) print part5
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question