Skip to main content

Code Challenge: Assault of the Darkness

Updated 1 min readMarkdown
Part of seriesCoding Exercises. Exercicios de Algoritmo/Programação
Code Challenge: Assault of the Darkness

[Desafio Investida das Trevas]
Um mago das trevas vai atacar um vilarejo e vai invocar 50 esqueletos para atacar com ele, mas um de maior vitalidade e outro de maior destreza ficarão ao seu lado para o proteger. Faça um programa que gere os 50 "esqueletos" automaticamente e aleatoriamente e indique entre os 50 os 2 que serão os guarda costas do mago das trevas.

[EN][Code Challenge: Assault of the Darkness] A Dark Mage will attack a village and will cast a spell to raise 50 skeletons to attack with him, but a skeleton of higher vitality and another of higher dexterity will stay by his side in order to protect him. Write the program that generates the 50 skeletons automatically and randomly and marks, among the 50, the two that will be the mage's bodyguards.

A Solution in C language.

https://gist.github.com/tictackode/9d79126ee60b9358b4cf2973e20f19ed

https://gist.github.com/tictackode/9d79126ee60b9358b4cf2973e20f19ed

A Solution in Python

https://gist.github.com/tictackode/47f2146f7bb01f4a65deac2ce5c2e527

https://gist.github.com/tictackode/47f2146f7bb01f4a65deac2ce5c2e527

About the author

  • I'm an Information Systems Bachelor that writes code even by hobby, and now got into a mathematics degree for teaching. Sou formado em Sistemas de Informação, estou cursando Licenciatura em Matemática pela UFF-CEDERJ, e amo programar.

No comments yet. Be the first to comment.

Coding Exercises. Exercicios de Algoritmo/Programação

Part 6 of 9

Nesta série postarei desafios de algoritmo originais e resoluções em diversas linguagens de programação. In this series I will post coding exercises and solutions in many programming languagens.

Up nextCode challenge: Dice Decision[Desafio Decisão nos Dados] O Zeca e a Aninha precisam decidir quem lava a louça hoje, e eles farão isso com dados comuns de seis lados (D6). Serão 3 partidas sendo que em cada uma eles lançarão 1 dad

More from this blog