Skip to main content
added 122 characters in body
Source Link
xnor
  • 146.6k
  • 26
  • 279
  • 652

Python 3, 72 bytes

dict(zip(l:="Cut Bomb Ice Fire Oil Elec Time Guts".split()*2,l[1:])).get

Try it online!

Creates a dictionary whose keys in order are Cut, Bomb, ... (doubled), and whose corresponding values are those with the first item removed. The main function is the .get method of the dictionary; if the dictionary itself suffices, those 4 bytes can be cut.

Also 72 bytes, using id just for as the shortest predefined variable:

{id:(id:=x)for x in"Cut Bomb Ice Fire Oil Elec Time Guts".split()*2}.get

Try it online!

Python, 73 bytes

lambda s:l[l.index(s)-1]
l="Guts Time Elec Oil Fire Ice Bomb Cut".split()

Try it online!

Uses that indices wrap around into the negatives, so the index before 0 is -1 which selects the last element.

Python 3, 73 bytes

lambda s:"Guts Time Oil Cut Elec Fire | Ice Bomb".split()[ord(s[0])%25%9]

Try it online!

Only looks at the first character of the inputboss's letter (which are all distinct), and uses a mod chain to classify it. Bytestring input would save 5 bytes.

Python 3, 72 bytes

dict(zip(l:="Cut Bomb Ice Fire Oil Elec Time Guts".split()*2,l[1:])).get

Try it online!

Creates a dictionary whose keys in order are Cut, Bomb, ... (doubled), and whose corresponding values are those with the first item removed. The main function is the .get method of the dictionary; if the dictionary itself suffices, those 4 bytes can be cut.

Also 72 bytes, using id just for as the shortest predefined variable:

{id:(id:=x)for x in"Cut Bomb Ice Fire Oil Elec Time Guts".split()*2}.get

Try it online!

Python, 73 bytes

lambda s:l[l.index(s)-1]
l="Guts Time Elec Oil Fire Ice Bomb Cut".split()

Try it online!

Python 3, 73 bytes

lambda s:"Guts Time Oil Cut Elec Fire | Ice Bomb".split()[ord(s[0])%25%9]

Try it online!

Only looks at the first character of the input, and uses a mod chain to classify it. Bytestring input would save 5 bytes.

Python 3, 72 bytes

dict(zip(l:="Cut Bomb Ice Fire Oil Elec Time Guts".split()*2,l[1:])).get

Try it online!

Creates a dictionary whose keys in order are Cut, Bomb, ... (doubled), and whose corresponding values are those with the first item removed. The main function is the .get method of the dictionary; if the dictionary itself suffices, those 4 bytes can be cut.

Also 72 bytes, using id just for as the shortest predefined variable:

{id:(id:=x)for x in"Cut Bomb Ice Fire Oil Elec Time Guts".split()*2}.get

Try it online!

Python, 73 bytes

lambda s:l[l.index(s)-1]
l="Guts Time Elec Oil Fire Ice Bomb Cut".split()

Try it online!

Uses that indices wrap around into the negatives, so the index before 0 is -1 which selects the last element.

Python 3, 73 bytes

lambda s:"Guts Time Oil Cut Elec Fire | Ice Bomb".split()[ord(s[0])%25%9]

Try it online!

Only looks at the boss's letter (which are all distinct), and uses a mod chain to classify it. Bytestring input would save 5 bytes.

Source Link
xnor
  • 146.6k
  • 26
  • 279
  • 652

Python 3, 72 bytes

dict(zip(l:="Cut Bomb Ice Fire Oil Elec Time Guts".split()*2,l[1:])).get

Try it online!

Creates a dictionary whose keys in order are Cut, Bomb, ... (doubled), and whose corresponding values are those with the first item removed. The main function is the .get method of the dictionary; if the dictionary itself suffices, those 4 bytes can be cut.

Also 72 bytes, using id just for as the shortest predefined variable:

{id:(id:=x)for x in"Cut Bomb Ice Fire Oil Elec Time Guts".split()*2}.get

Try it online!

Python, 73 bytes

lambda s:l[l.index(s)-1]
l="Guts Time Elec Oil Fire Ice Bomb Cut".split()

Try it online!

Python 3, 73 bytes

lambda s:"Guts Time Oil Cut Elec Fire | Ice Bomb".split()[ord(s[0])%25%9]

Try it online!

Only looks at the first character of the input, and uses a mod chain to classify it. Bytestring input would save 5 bytes.