Challenge 5: 100 people and a Sword. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Challenge 5: 100 people and a Sword.

Well This is a version of Ace's challenge. There are 100 people and one sword. The first kills the next two and hands the sword to the fourth one who also kills the next two. This continues till there is just one person left. Write a code to display who killed whom, who killed the most people, and who survived. The people can kill one person in case there are only two left(The killer and the victim).

30th Jun 2017, 8:59 AM
Dragon Slayer Xavier
Dragon Slayer Xavier - avatar
11 Answers
+ 6
just modify the original one https://code.sololearn.com/cx0F28cKt8ni ------------------------------------- wait, i didn't notice that the killer-victim relation should also be displayed... let me think for a while... ------------------------------------- ok, now i've completed all requirements
30th Jun 2017, 10:32 AM
Flandre Scarlet
Flandre Scarlet - avatar
+ 8
It won't change the algorithm much though
30th Jun 2017, 9:11 AM
jay
jay - avatar
30th Jun 2017, 9:02 AM
Nomeh Uchenna Gabriel
Nomeh Uchenna Gabriel - avatar
+ 4
Well Here they kill two people...
30th Jun 2017, 9:04 AM
Dragon Slayer Xavier
Dragon Slayer Xavier - avatar
+ 4
yeah I know
30th Jun 2017, 9:05 AM
Nomeh Uchenna Gabriel
Nomeh Uchenna Gabriel - avatar
30th Jun 2017, 9:25 AM
๐Ÿ‘‘ Prometheus ๐Ÿ‡ธ๐Ÿ‡ฌ
๐Ÿ‘‘ Prometheus ๐Ÿ‡ธ๐Ÿ‡ฌ - avatar
+ 3
I used math and got the answer to be 82, armed with notepad and Python IDLE 3.6.1. Publishing a code to show it...
30th Jun 2017, 10:10 AM
๐Ÿ‘‘ Prometheus ๐Ÿ‡ธ๐Ÿ‡ฌ
๐Ÿ‘‘ Prometheus ๐Ÿ‡ธ๐Ÿ‡ฌ - avatar
+ 3
What? So am I wrong?
30th Jun 2017, 1:38 PM
๐Ÿ‘‘ Prometheus ๐Ÿ‡ธ๐Ÿ‡ฌ
๐Ÿ‘‘ Prometheus ๐Ÿ‡ธ๐Ÿ‡ฌ - avatar
+ 3
yeah @Scarlet, I also got 70. so no need for my web version.
30th Jun 2017, 3:02 PM
Nomeh Uchenna Gabriel
Nomeh Uchenna Gabriel - avatar
24th Jul 2017, 9:53 PM
Garikai
Garikai - avatar
0
Well Vengat, your code gives me an error.
30th Jun 2017, 2:47 PM
Dragon Slayer Xavier
Dragon Slayer Xavier - avatar