Skip to main content
deleted 13 characters in body
Source Link
Domenico
  • 2.5k
  • 5
  • 5

#Cheat activated

###Background

The game Grand Theft Auto: San Andreas went down to history also thanks to its wide selection of cheats. They're almost 90 and anyone who has ever touched this game, no doubt he tried them all!
One cheat is activated (on PC) typing in-game a secret keyword, and then boom, a jet pops out of thin air or perhaps all pedestrians look like Elvis Presley or some other rowdy effect...

They always come with this confirmation message:

enter image description here

Rockstar choosed to store them hashed, so due to collision, in addition to the intended ones there are many other strings that trigger every cheat.

Therefore I propose to solve this downside!

##Task

Write a full program that prints CHEAT ACTIVATED if and only if the last part of a string is a cheat code.

##Cheat codes

THUGSARMOURY PROFESSIONALSKIT NUTTERSTOYS INEEDSOMEHELP TURNUPTHEHEAT TURNDOWNTHEHEAT PLEASANTLYWARM TOODAMNHOT DULLDULLDAY STAYINANDWATCHTV CANTSEEWHEREIMGOING TIMEJUSTFLIESBY SPEEDITUP SLOWITDOWN ROUGHNEIGHBOURHOOD STOPPICKINGONME SURROUNDEDBYNUTTERS TIMETOKICKASS OLDSPEEDDEMON DOUGHNUTHANDICAP NOTFORPUBLICROADS JUSTTRYANDSTOPME WHERESTHEFUNERAL CELEBRITYSTATUS TRUEGRIME 18HOLES ALLCARSGOBOOM WHEELSONLYPLEASE STICKLIKEGLUE GOODBYECRUELWORLD DONTTRYANDSTOPME ALLDRIVERSARECRIMINALS PINKISTHENEWCOOL SOLONGASITSBLACK FLYINGFISH WHOATEALLTHEPIES BUFFMEUP LEANANDMEAN BLUESUEDESHOES ATTACKOFTHEVILLAGEPEOPLE LIFESABEACH ONLYHOMIESALLOWED BETTERSTAYINDOORS NINJATOWN LOVECONQUERSALL EVERYONEISPOOR EVERYONEISRICH CHITTYCHITTYBANGBANG CJPHONEHOME JUMPJET IWANTTOHOVER TOUCHMYCARYOUDIE SPEEDFREAK BUBBLECARS NIGHTPROWLER DONTBRINGONTHENIGHT SCOTTISHSUMMER SANDINMYEARS KANGAROO NOONECANHURTME MANFROMATLANTIS LETSGOBASEJUMPING ROCKETMAN IDOASIPLEASE BRINGITON STINGLIKEABEE IAMNEVERHUNGRY STATEOFEMERGENCY CRAZYTOWN TAKEACHILLPILL FULLCLIP IWANNADRIVEBY GHOSTTOWN HICKSVILLE WANNABEINMYGANG NOONECANSTOPUS ROCKETMAYHEM WORSHIPME HELLOLADIES ICANGOALLNIGHT PROFESSIONALKILLER NATURALTALENT OHDUDE FOURWHEELFUN HITTHEROADJACK ITSALLBULL FLYINGTOSTUNT MONSTERMASH 

##Input

  • A string \$s\$ over the alphabet:
    [A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z]

#Output

  • Print CHEAT ACTIVATED if there exist a cheat code \$c\$ such that \$c\$ is a suffix of \$s\$
  • Nothing otherwise

This is , so the shortest code wins.

#Cheat activated

###Background

The game Grand Theft Auto: San Andreas went down to history also thanks to its wide selection of cheats. They're almost 90 and anyone who has ever touched this game, no doubt he tried them all!
One cheat is activated (on PC) typing in-game a secret keyword, and then boom, a jet pops out of thin air or perhaps all pedestrians look like Elvis Presley or some other rowdy effect...

They always come with this confirmation message:

enter image description here

Rockstar choosed to store them hashed, so due to collision, in addition to the intended ones there are many other strings that trigger every cheat.

Therefore I propose to solve this downside!

##Task

Write a full program that prints CHEAT ACTIVATED if and only if the last part of a string is a cheat code.

##Cheat codes

THUGSARMOURY PROFESSIONALSKIT NUTTERSTOYS INEEDSOMEHELP TURNUPTHEHEAT TURNDOWNTHEHEAT PLEASANTLYWARM TOODAMNHOT DULLDULLDAY STAYINANDWATCHTV CANTSEEWHEREIMGOING TIMEJUSTFLIESBY SPEEDITUP SLOWITDOWN ROUGHNEIGHBOURHOOD STOPPICKINGONME SURROUNDEDBYNUTTERS TIMETOKICKASS OLDSPEEDDEMON DOUGHNUTHANDICAP NOTFORPUBLICROADS JUSTTRYANDSTOPME WHERESTHEFUNERAL CELEBRITYSTATUS TRUEGRIME 18HOLES ALLCARSGOBOOM WHEELSONLYPLEASE STICKLIKEGLUE GOODBYECRUELWORLD DONTTRYANDSTOPME ALLDRIVERSARECRIMINALS PINKISTHENEWCOOL SOLONGASITSBLACK FLYINGFISH WHOATEALLTHEPIES BUFFMEUP LEANANDMEAN BLUESUEDESHOES ATTACKOFTHEVILLAGEPEOPLE LIFESABEACH ONLYHOMIESALLOWED BETTERSTAYINDOORS NINJATOWN LOVECONQUERSALL EVERYONEISPOOR EVERYONEISRICH CHITTYCHITTYBANGBANG CJPHONEHOME JUMPJET IWANTTOHOVER TOUCHMYCARYOUDIE SPEEDFREAK BUBBLECARS NIGHTPROWLER DONTBRINGONTHENIGHT SCOTTISHSUMMER SANDINMYEARS KANGAROO NOONECANHURTME MANFROMATLANTIS LETSGOBASEJUMPING ROCKETMAN IDOASIPLEASE BRINGITON STINGLIKEABEE IAMNEVERHUNGRY STATEOFEMERGENCY CRAZYTOWN TAKEACHILLPILL FULLCLIP IWANNADRIVEBY GHOSTTOWN HICKSVILLE WANNABEINMYGANG NOONECANSTOPUS ROCKETMAYHEM WORSHIPME HELLOLADIES ICANGOALLNIGHT PROFESSIONALKILLER NATURALTALENT OHDUDE FOURWHEELFUN HITTHEROADJACK ITSALLBULL FLYINGTOSTUNT MONSTERMASH 

##Input

  • A string \$s\$ over the alphabet:
    [A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z]

#Output

  • Print CHEAT ACTIVATED if there exist a cheat code \$c\$ such that \$c\$ is a suffix of \$s\$
  • Nothing otherwise

This is , so the shortest code wins.

#Cheat activated

###Background

The game Grand Theft Auto: San Andreas went down to history also thanks to its wide selection of cheats. They're almost 90 and anyone who has ever touched this game, no doubt he tried them all!
One cheat is activated (on PC) typing in-game a secret keyword, and then boom, a jet pops out of thin air or perhaps all pedestrians look like Elvis Presley or some other rowdy effect...

They always come with this confirmation message:

enter image description here

Rockstar choosed to store them hashed, so due to collision, in addition to the intended ones there are many other strings that trigger every cheat.

Therefore I propose to solve this downside!

##Task

Write a full program that prints CHEAT ACTIVATED if and only if the last part of a string is a cheat code.

##Cheat codes

THUGSARMOURY PROFESSIONALSKIT NUTTERSTOYS INEEDSOMEHELP TURNUPTHEHEAT TURNDOWNTHEHEAT PLEASANTLYWARM TOODAMNHOT DULLDULLDAY STAYINANDWATCHTV CANTSEEWHEREIMGOING TIMEJUSTFLIESBY SPEEDITUP SLOWITDOWN ROUGHNEIGHBOURHOOD STOPPICKINGONME SURROUNDEDBYNUTTERS TIMETOKICKASS OLDSPEEDDEMON DOUGHNUTHANDICAP NOTFORPUBLICROADS JUSTTRYANDSTOPME WHERESTHEFUNERAL CELEBRITYSTATUS TRUEGRIME ALLCARSGOBOOM WHEELSONLYPLEASE STICKLIKEGLUE GOODBYECRUELWORLD DONTTRYANDSTOPME ALLDRIVERSARECRIMINALS PINKISTHENEWCOOL SOLONGASITSBLACK FLYINGFISH WHOATEALLTHEPIES BUFFMEUP LEANANDMEAN BLUESUEDESHOES ATTACKOFTHEVILLAGEPEOPLE LIFESABEACH ONLYHOMIESALLOWED BETTERSTAYINDOORS NINJATOWN LOVECONQUERSALL EVERYONEISPOOR EVERYONEISRICH CHITTYCHITTYBANGBANG CJPHONEHOME JUMPJET IWANTTOHOVER TOUCHMYCARYOUDIE SPEEDFREAK BUBBLECARS NIGHTPROWLER DONTBRINGONTHENIGHT SCOTTISHSUMMER SANDINMYEARS KANGAROO NOONECANHURTME MANFROMATLANTIS LETSGOBASEJUMPING ROCKETMAN IDOASIPLEASE BRINGITON STINGLIKEABEE IAMNEVERHUNGRY STATEOFEMERGENCY CRAZYTOWN TAKEACHILLPILL FULLCLIP IWANNADRIVEBY GHOSTTOWN HICKSVILLE WANNABEINMYGANG NOONECANSTOPUS ROCKETMAYHEM WORSHIPME HELLOLADIES ICANGOALLNIGHT PROFESSIONALKILLER NATURALTALENT OHDUDE FOURWHEELFUN HITTHEROADJACK ITSALLBULL FLYINGTOSTUNT MONSTERMASH 

##Input

  • A string \$s\$ over the alphabet:
    [A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z]

#Output

  • Print CHEAT ACTIVATED if there exist a cheat code \$c\$ such that \$c\$ is a suffix of \$s\$
  • Nothing otherwise

This is , so the shortest code wins.

I've shut out the cheat `18HOLES` because it's the only one containing numbers.
Source Link
Domenico
  • 2.5k
  • 5
  • 5

#Cheat activated

###Background

The game Grand Theft Auto: San Andreas went down to history also thanks to its wide selection of cheats. They're almost 90 and anyone who has ever touched this game, no doubt he tried them all!
One cheat is activated (on PC) typing in-game a secret keyword, and then boom, a jet pops out of thin air or perhaps all pedestrians look like Elvis Presley or some other rowdy effect...

They always come with this confirmation message:

enter image description here

Rockstar choosed to store them hashed, so due to collision, in addition to the intended cheat codesintended ones there are many other combinations of lettersstrings that trigger every cheat.

Therefore I propose to solve this downside!

##Task

Write a full program that prints CheatCHEAT activatedACTIVATED if and only if the last part of a string is a cheat code.

##Cheat codes

THUGSARMOURY PROFESSIONALSKIT NUTTERSTOYS INEEDSOMEHELP TURNUPTHEHEAT TURNDOWNTHEHEAT PLEASANTLYWARM TOODAMNHOT DULLDULLDAY STAYINANDWATCHTV CANTSEEWHEREIMGOING TIMEJUSTFLIESBY SPEEDITUP SLOWITDOWN ROUGHNEIGHBOURHOOD STOPPICKINGONME SURROUNDEDBYNUTTERS TIMETOKICKASS OLDSPEEDDEMON DOUGHNUTHANDICAP NOTFORPUBLICROADS JUSTTRYANDSTOPME WHERESTHEFUNERAL CELEBRITYSTATUS TRUEGRIME 18HOLES ALLCARSGOBOOM WHEELSONLYPLEASE STICKLIKEGLUE GOODBYECRUELWORLD DONTTRYANDSTOPME ALLDRIVERSARECRIMINALS PINKISTHENEWCOOL SOLONGASITSBLACK FLYINGFISH WHOATEALLTHEPIES BUFFMEUP LEANANDMEAN BLUESUEDESHOES ATTACKOFTHEVILLAGEPEOPLE LIFESABEACH ONLYHOMIESALLOWED BETTERSTAYINDOORS NINJATOWN LOVECONQUERSALL EVERYONEISPOOR EVERYONEISRICH CHITTYCHITTYBANGBANG CJPHONEHOME JUMPJET IWANTTOHOVER TOUCHMYCARYOUDIE SPEEDFREAK BUBBLECARS NIGHTPROWLER DONTBRINGONTHENIGHT SCOTTISHSUMMER SANDINMYEARS KANGAROO NOONECANHURTME MANFROMATLANTIS LETSGOBASEJUMPING ROCKETMAN IDOASIPLEASE BRINGITON STINGLIKEABEE IAMNEVERHUNGRY STATEOFEMERGENCY CRAZYTOWN TAKEACHILLPILL FULLCLIP IWANNADRIVEBY GHOSTTOWN HICKSVILLE WANNABEINMYGANG NOONECANSTOPUS ROCKETMAYHEM WORSHIPME HELLOLADIES ICANGOALLNIGHT PROFESSIONALKILLER NATURALTALENT OHDUDE FOURWHEELFUN HITTHEROADJACK ITSALLBULL FLYINGTOSTUNT MONSTERMASH 

##Input

  • A string \$s\$ over the alphabet ...:
    [A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z]

SANDBOX, which alphabet???
GTA SA converts all input in uppercase so if if it wasn't for the cheat code 18HOLES I would choose the upper case letters as alphabet. I don't want to remove it... Should I add the digits? All digits and capital letters? (We can also pick one of its collision RZHSUEW, but we'd ruin the fact that they are all english words, and the intended ones)

#Output

  • Print CheatCHEAT activatedACTIVATED if there exist a cheat code \$c\$ such that \$c\$ is a suffix of \$s\$
  • Nothing otherwise

##Examples

 -> AIDVNIOHDUDE -> Cheat activated ZCRAZYTOWNXQPOJ -> TRUEGRIME -> Cheat activated 

This is , so the shortest code wins.

#Cheat activated

###Background

The game Grand Theft Auto: San Andreas went down to history also thanks to its wide selection of cheats. They're almost 90 and anyone who has ever touched this game, no doubt he tried them all!
One cheat is activated (on PC) typing in-game a secret keyword, and then boom, a jet pops out of thin air or perhaps all pedestrians look like Elvis Presley or some other rowdy effect...

They always come with this confirmation message:

enter image description here

Rockstar choosed to store them hashed, so due to collision, in addition to the intended cheat codes there are many other combinations of letters that trigger every cheat.

Therefore I propose to solve this downside!

##Task

Write a full program that prints Cheat activated only if the last part of a string is a cheat code.

##Cheat codes

THUGSARMOURY PROFESSIONALSKIT NUTTERSTOYS INEEDSOMEHELP TURNUPTHEHEAT TURNDOWNTHEHEAT PLEASANTLYWARM TOODAMNHOT DULLDULLDAY STAYINANDWATCHTV CANTSEEWHEREIMGOING TIMEJUSTFLIESBY SPEEDITUP SLOWITDOWN ROUGHNEIGHBOURHOOD STOPPICKINGONME SURROUNDEDBYNUTTERS TIMETOKICKASS OLDSPEEDDEMON DOUGHNUTHANDICAP NOTFORPUBLICROADS JUSTTRYANDSTOPME WHERESTHEFUNERAL CELEBRITYSTATUS TRUEGRIME 18HOLES ALLCARSGOBOOM WHEELSONLYPLEASE STICKLIKEGLUE GOODBYECRUELWORLD DONTTRYANDSTOPME ALLDRIVERSARECRIMINALS PINKISTHENEWCOOL SOLONGASITSBLACK FLYINGFISH WHOATEALLTHEPIES BUFFMEUP LEANANDMEAN BLUESUEDESHOES ATTACKOFTHEVILLAGEPEOPLE LIFESABEACH ONLYHOMIESALLOWED BETTERSTAYINDOORS NINJATOWN LOVECONQUERSALL EVERYONEISPOOR EVERYONEISRICH CHITTYCHITTYBANGBANG CJPHONEHOME JUMPJET IWANTTOHOVER TOUCHMYCARYOUDIE SPEEDFREAK BUBBLECARS NIGHTPROWLER DONTBRINGONTHENIGHT SCOTTISHSUMMER SANDINMYEARS KANGAROO NOONECANHURTME MANFROMATLANTIS LETSGOBASEJUMPING ROCKETMAN IDOASIPLEASE BRINGITON STINGLIKEABEE IAMNEVERHUNGRY STATEOFEMERGENCY CRAZYTOWN TAKEACHILLPILL FULLCLIP IWANNADRIVEBY GHOSTTOWN HICKSVILLE WANNABEINMYGANG NOONECANSTOPUS ROCKETMAYHEM WORSHIPME HELLOLADIES ICANGOALLNIGHT PROFESSIONALKILLER NATURALTALENT OHDUDE FOURWHEELFUN HITTHEROADJACK ITSALLBULL FLYINGTOSTUNT MONSTERMASH 

##Input

  • A string \$s\$ over the alphabet ...

SANDBOX, which alphabet???
GTA SA converts all input in uppercase so if if it wasn't for the cheat code 18HOLES I would choose the upper case letters as alphabet. I don't want to remove it... Should I add the digits? All digits and capital letters? (We can also pick one of its collision RZHSUEW, but we'd ruin the fact that they are all english words, and the intended ones)

#Output

  • Print Cheat activated if there exist a cheat code \$c\$ such that \$c\$ is a suffix of \$s\$
  • Nothing otherwise

##Examples

 -> AIDVNIOHDUDE -> Cheat activated ZCRAZYTOWNXQPOJ -> TRUEGRIME -> Cheat activated 

This is , so the shortest code wins.

#Cheat activated

###Background

The game Grand Theft Auto: San Andreas went down to history also thanks to its wide selection of cheats. They're almost 90 and anyone who has ever touched this game, no doubt he tried them all!
One cheat is activated (on PC) typing in-game a secret keyword, and then boom, a jet pops out of thin air or perhaps all pedestrians look like Elvis Presley or some other rowdy effect...

They always come with this confirmation message:

enter image description here

Rockstar choosed to store them hashed, so due to collision, in addition to the intended ones there are many other strings that trigger every cheat.

Therefore I propose to solve this downside!

##Task

Write a full program that prints CHEAT ACTIVATED if and only if the last part of a string is a cheat code.

##Cheat codes

THUGSARMOURY PROFESSIONALSKIT NUTTERSTOYS INEEDSOMEHELP TURNUPTHEHEAT TURNDOWNTHEHEAT PLEASANTLYWARM TOODAMNHOT DULLDULLDAY STAYINANDWATCHTV CANTSEEWHEREIMGOING TIMEJUSTFLIESBY SPEEDITUP SLOWITDOWN ROUGHNEIGHBOURHOOD STOPPICKINGONME SURROUNDEDBYNUTTERS TIMETOKICKASS OLDSPEEDDEMON DOUGHNUTHANDICAP NOTFORPUBLICROADS JUSTTRYANDSTOPME WHERESTHEFUNERAL CELEBRITYSTATUS TRUEGRIME 18HOLES ALLCARSGOBOOM WHEELSONLYPLEASE STICKLIKEGLUE GOODBYECRUELWORLD DONTTRYANDSTOPME ALLDRIVERSARECRIMINALS PINKISTHENEWCOOL SOLONGASITSBLACK FLYINGFISH WHOATEALLTHEPIES BUFFMEUP LEANANDMEAN BLUESUEDESHOES ATTACKOFTHEVILLAGEPEOPLE LIFESABEACH ONLYHOMIESALLOWED BETTERSTAYINDOORS NINJATOWN LOVECONQUERSALL EVERYONEISPOOR EVERYONEISRICH CHITTYCHITTYBANGBANG CJPHONEHOME JUMPJET IWANTTOHOVER TOUCHMYCARYOUDIE SPEEDFREAK BUBBLECARS NIGHTPROWLER DONTBRINGONTHENIGHT SCOTTISHSUMMER SANDINMYEARS KANGAROO NOONECANHURTME MANFROMATLANTIS LETSGOBASEJUMPING ROCKETMAN IDOASIPLEASE BRINGITON STINGLIKEABEE IAMNEVERHUNGRY STATEOFEMERGENCY CRAZYTOWN TAKEACHILLPILL FULLCLIP IWANNADRIVEBY GHOSTTOWN HICKSVILLE WANNABEINMYGANG NOONECANSTOPUS ROCKETMAYHEM WORSHIPME HELLOLADIES ICANGOALLNIGHT PROFESSIONALKILLER NATURALTALENT OHDUDE FOURWHEELFUN HITTHEROADJACK ITSALLBULL FLYINGTOSTUNT MONSTERMASH 

##Input

  • A string \$s\$ over the alphabet:
    [A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z]

#Output

  • Print CHEAT ACTIVATED if there exist a cheat code \$c\$ such that \$c\$ is a suffix of \$s\$
  • Nothing otherwise

This is , so the shortest code wins.

added 35 characters in body
Source Link
Domenico
  • 2.5k
  • 5
  • 5

#Cheat activated

###Background

The game Grand Theft Auto: San Andreas went down to history also thanks to its wide selection of cheats. They're almost 90 and anyone who has ever touched this game, no doubt he tried them all!
One cheat is activated (on PC) typing in-game a secret keyword, and then boom, a jet pops out of thin air or perhaps all pedestrians look like Elvis Presley or some other rowdy effect...

They always come with this confirmation message:

enter image description here

Rockstar choosed to store them hashed, so due to collision, in addition to the intended cheat codes there are many other combinations of letters that trigger every cheat.

Therefore I propose to solve this downside!

##Task

Write a full program that recognizesprints Cheat activated only if the last part of a string beingis a cheat code.

##Cheat codes

THUGSARMOURY PROFESSIONALSKIT NUTTERSTOYS INEEDSOMEHELP TURNUPTHEHEAT TURNDOWNTHEHEAT PLEASANTLYWARM TOODAMNHOT DULLDULLDAY STAYINANDWATCHTV CANTSEEWHEREIMGOING TIMEJUSTFLIESBY SPEEDITUP SLOWITDOWN ROUGHNEIGHBOURHOOD STOPPICKINGONME SURROUNDEDBYNUTTERS TIMETOKICKASS OLDSPEEDDEMON DOUGHNUTHANDICAP NOTFORPUBLICROADS JUSTTRYANDSTOPME WHERESTHEFUNERAL CELEBRITYSTATUS TRUEGRIME 18HOLES ALLCARSGOBOOM WHEELSONLYPLEASE STICKLIKEGLUE GOODBYECRUELWORLD DONTTRYANDSTOPME ALLDRIVERSARECRIMINALS PINKISTHENEWCOOL SOLONGASITSBLACK FLYINGFISH WHOATEALLTHEPIES BUFFMEUP LEANANDMEAN BLUESUEDESHOES ATTACKOFTHEVILLAGEPEOPLE LIFESABEACH ONLYHOMIESALLOWED BETTERSTAYINDOORS NINJATOWN LOVECONQUERSALL EVERYONEISPOOR EVERYONEISRICH CHITTYCHITTYBANGBANG CJPHONEHOME JUMPJET IWANTTOHOVER TOUCHMYCARYOUDIE SPEEDFREAK BUBBLECARS NIGHTPROWLER DONTBRINGONTHENIGHT SCOTTISHSUMMER SANDINMYEARS KANGAROO NOONECANHURTME MANFROMATLANTIS LETSGOBASEJUMPING ROCKETMAN IDOASIPLEASE BRINGITON STINGLIKEABEE IAMNEVERHUNGRY STATEOFEMERGENCY CRAZYTOWN TAKEACHILLPILL FULLCLIP IWANNADRIVEBY GHOSTTOWN HICKSVILLE WANNABEINMYGANG NOONECANSTOPUS ROCKETMAYHEM WORSHIPME HELLOLADIES ICANGOALLNIGHT PROFESSIONALKILLER NATURALTALENT OHDUDE FOURWHEELFUN HITTHEROADJACK ITSALLBULL FLYINGTOSTUNT MONSTERMASH 

##Input

  • A string \$s\$ over the alphabet ...

SANDBOX, which alphabet???
GTA SA converts all input in uppercase so if if it wasn't for the cheat code 18HOLES I would choose the upper case letters as alphabet. I don't want to remove it... Should I add the digits? All digits and capital letters? (We can also pick one of its collision RZHSUEW, but we'd ruin the fact that they are all english words, and the intended ones)

#Output

  • Print Cheat activated if there exist a cheat code \$c\$ such that \$c\$ is a suffix of \$s\$
  • Nothing otherwise

##Examples

 -> AIDVNIOHDUDE -> Cheat activated ZCRAZYTOWNXQPOJ -> TRUEGRIME -> Cheat activated 

This is , so the shortest code wins.

#Cheat activated

###Background

The game Grand Theft Auto: San Andreas went down to history also thanks to its wide selection of cheats. They're almost 90 and anyone who has ever touched this game, no doubt he tried them all!
One cheat is activated (on PC) typing in-game a secret keyword, and then boom, a jet pops out of thin air or perhaps all pedestrians look like Elvis Presley or some other rowdy effect...

They always come with this confirmation message:

enter image description here

Rockstar choosed to store them hashed, so due to collision, in addition to the intended cheat codes there are many other combinations of letters that trigger every cheat.

Therefore I propose to solve this downside!

##Task

Write a full program that recognizes the last part of a string being a cheat code.

##Cheat codes

THUGSARMOURY PROFESSIONALSKIT NUTTERSTOYS INEEDSOMEHELP TURNUPTHEHEAT TURNDOWNTHEHEAT PLEASANTLYWARM TOODAMNHOT DULLDULLDAY STAYINANDWATCHTV CANTSEEWHEREIMGOING TIMEJUSTFLIESBY SPEEDITUP SLOWITDOWN ROUGHNEIGHBOURHOOD STOPPICKINGONME SURROUNDEDBYNUTTERS TIMETOKICKASS OLDSPEEDDEMON DOUGHNUTHANDICAP NOTFORPUBLICROADS JUSTTRYANDSTOPME WHERESTHEFUNERAL CELEBRITYSTATUS TRUEGRIME 18HOLES ALLCARSGOBOOM WHEELSONLYPLEASE STICKLIKEGLUE GOODBYECRUELWORLD DONTTRYANDSTOPME ALLDRIVERSARECRIMINALS PINKISTHENEWCOOL SOLONGASITSBLACK FLYINGFISH WHOATEALLTHEPIES BUFFMEUP LEANANDMEAN BLUESUEDESHOES ATTACKOFTHEVILLAGEPEOPLE LIFESABEACH ONLYHOMIESALLOWED BETTERSTAYINDOORS NINJATOWN LOVECONQUERSALL EVERYONEISPOOR EVERYONEISRICH CHITTYCHITTYBANGBANG CJPHONEHOME JUMPJET IWANTTOHOVER TOUCHMYCARYOUDIE SPEEDFREAK BUBBLECARS NIGHTPROWLER DONTBRINGONTHENIGHT SCOTTISHSUMMER SANDINMYEARS KANGAROO NOONECANHURTME MANFROMATLANTIS LETSGOBASEJUMPING ROCKETMAN IDOASIPLEASE BRINGITON STINGLIKEABEE IAMNEVERHUNGRY STATEOFEMERGENCY CRAZYTOWN TAKEACHILLPILL FULLCLIP IWANNADRIVEBY GHOSTTOWN HICKSVILLE WANNABEINMYGANG NOONECANSTOPUS ROCKETMAYHEM WORSHIPME HELLOLADIES ICANGOALLNIGHT PROFESSIONALKILLER NATURALTALENT OHDUDE FOURWHEELFUN HITTHEROADJACK ITSALLBULL FLYINGTOSTUNT MONSTERMASH 

##Input

  • A string \$s\$ over the alphabet ...

SANDBOX, which alphabet???
GTA SA converts all input in uppercase so if if it wasn't for the cheat code 18HOLES I would choose the upper case letters as alphabet. I don't want to remove it... Should I add the digits? All digits and capital letters? (We can also pick one of its collision RZHSUEW, but we'd ruin the fact that they are all english words, and the intended ones)

#Output

  • Print Cheat activated if there exist a cheat code \$c\$ such that \$c\$ is a suffix of \$s\$
  • Nothing otherwise

##Examples

 -> AIDVNIOHDUDE -> Cheat activated ZCRAZYTOWNXQPOJ -> TRUEGRIME -> Cheat activated 

This is , so the shortest code wins.

#Cheat activated

###Background

The game Grand Theft Auto: San Andreas went down to history also thanks to its wide selection of cheats. They're almost 90 and anyone who has ever touched this game, no doubt he tried them all!
One cheat is activated (on PC) typing in-game a secret keyword, and then boom, a jet pops out of thin air or perhaps all pedestrians look like Elvis Presley or some other rowdy effect...

They always come with this confirmation message:

enter image description here

Rockstar choosed to store them hashed, so due to collision, in addition to the intended cheat codes there are many other combinations of letters that trigger every cheat.

Therefore I propose to solve this downside!

##Task

Write a full program that prints Cheat activated only if the last part of a string is a cheat code.

##Cheat codes

THUGSARMOURY PROFESSIONALSKIT NUTTERSTOYS INEEDSOMEHELP TURNUPTHEHEAT TURNDOWNTHEHEAT PLEASANTLYWARM TOODAMNHOT DULLDULLDAY STAYINANDWATCHTV CANTSEEWHEREIMGOING TIMEJUSTFLIESBY SPEEDITUP SLOWITDOWN ROUGHNEIGHBOURHOOD STOPPICKINGONME SURROUNDEDBYNUTTERS TIMETOKICKASS OLDSPEEDDEMON DOUGHNUTHANDICAP NOTFORPUBLICROADS JUSTTRYANDSTOPME WHERESTHEFUNERAL CELEBRITYSTATUS TRUEGRIME 18HOLES ALLCARSGOBOOM WHEELSONLYPLEASE STICKLIKEGLUE GOODBYECRUELWORLD DONTTRYANDSTOPME ALLDRIVERSARECRIMINALS PINKISTHENEWCOOL SOLONGASITSBLACK FLYINGFISH WHOATEALLTHEPIES BUFFMEUP LEANANDMEAN BLUESUEDESHOES ATTACKOFTHEVILLAGEPEOPLE LIFESABEACH ONLYHOMIESALLOWED BETTERSTAYINDOORS NINJATOWN LOVECONQUERSALL EVERYONEISPOOR EVERYONEISRICH CHITTYCHITTYBANGBANG CJPHONEHOME JUMPJET IWANTTOHOVER TOUCHMYCARYOUDIE SPEEDFREAK BUBBLECARS NIGHTPROWLER DONTBRINGONTHENIGHT SCOTTISHSUMMER SANDINMYEARS KANGAROO NOONECANHURTME MANFROMATLANTIS LETSGOBASEJUMPING ROCKETMAN IDOASIPLEASE BRINGITON STINGLIKEABEE IAMNEVERHUNGRY STATEOFEMERGENCY CRAZYTOWN TAKEACHILLPILL FULLCLIP IWANNADRIVEBY GHOSTTOWN HICKSVILLE WANNABEINMYGANG NOONECANSTOPUS ROCKETMAYHEM WORSHIPME HELLOLADIES ICANGOALLNIGHT PROFESSIONALKILLER NATURALTALENT OHDUDE FOURWHEELFUN HITTHEROADJACK ITSALLBULL FLYINGTOSTUNT MONSTERMASH 

##Input

  • A string \$s\$ over the alphabet ...

SANDBOX, which alphabet???
GTA SA converts all input in uppercase so if if it wasn't for the cheat code 18HOLES I would choose the upper case letters as alphabet. I don't want to remove it... Should I add the digits? All digits and capital letters? (We can also pick one of its collision RZHSUEW, but we'd ruin the fact that they are all english words, and the intended ones)

#Output

  • Print Cheat activated if there exist a cheat code \$c\$ such that \$c\$ is a suffix of \$s\$
  • Nothing otherwise

##Examples

 -> AIDVNIOHDUDE -> Cheat activated ZCRAZYTOWNXQPOJ -> TRUEGRIME -> Cheat activated 

This is , so the shortest code wins.

edited body
Source Link
Domenico
  • 2.5k
  • 5
  • 5
Loading
Source Link
Domenico
  • 2.5k
  • 5
  • 5
Loading