Visual illustration of the code challenge: Orion – Défense spatiale #2

Orion – Défense spatiale #2

Continue ton analyse pour définir la vague la plus puissante parmi celles en approche.

Coding in the sandbox You must be logged in to access the sandbox.

Mission

L’analyse des vagues ennemies se poursuit. Cette fois-ci il est question d’estimer la puissance de chaque vague pour déterminer laquelle est la plus importante.

Règles

Voici comment calculer la puissance d’une vague. Chaque type de vaisseau a un « poids » en points de puissance :

  • A => Attack => 5 points de puissance
  • D => Defense => 3 points de puissance
  • S => Support => 2 points de puissance
  • B => Bomber => 8 points de puissance

En complément, 2 vaisseaux Attack qui se suivent rajoutent 1 point de puissance. Si 3 vaisseaux Attack se suivent, cela rajoute 2 points, et ainsi de suite.

  • A => 5 points
  • ASA => 5 + 2 + 5 = 12 points
  • AAS => 5 + 5 + 1 bonus + 2 = 13 points
  • DAAAD => 3 + 5 + 5 + 5 + 2 bonus + 3 = 23 points

Il en est de même pour les vaisseaux Bomber. Mais pas pour les vaisseaux Defense ou Support.

Précision, une séquence « AB » n’octroie pas de point supplémentaire.

Tu dois retourner la puissance maximale parmi les puissances de toutes les vagues.

Solve the challenge

To code this challenge, several possibilities:
- Want to start coding right away? Use the online Sandbox.
- Want to work in your favorite editor? Organize your code well, test, check out our API documentation.
- You can also copy/paste a dataset below.

challenge code for resolution via API: INVASION_1

Some resources to help you:
Data and algorithmic logic Methodologies Corrections

Support for resolution

Progress through challenges using our resolution aids: tools, techniques and advice to help you overcome the most complex programming challenges with methodology, confidence and creativity.

Dataset and algorithmic logic

Based on the data and the expected response, use the process to determine the logic to implement.

Show data and progress

Methodologies

Develop a structured approach with our solving guides. Work on specific concepts such as object-oriented programming or unit testing to improve your coding style and progress.

No methodology yet for this challenge, but we are working on it! Follow us to be informed of the release!


Corrections

The corrections allow you to discover certain technical concepts but will also give you a solution to the challenge. Code the challenge yourself before consulting the corrections ;)

No answer yet for this challenge, but we&'re working on it! Follow us to be informed of the release!

Programming concept(s) that can be used to solve this challenge: Conditions, Parsing, Chaines de caractères, Calculs

Keep coding

Other challenges to complete

Beginner
Bug-out Shelter #3 – Remote Connection

Bug-out Shelter #3 – Remote Connection

Calculation Corrigé disponible : Java
Beginner
Bug-out Shelter #4 – Vital Silence

Bug-out Shelter #4 – Vital Silence

Calculation Corrigé disponible : C#
Beginner
Team Pokemon

Team Pokemon

Tu veux être le meilleur dresseur ? On va voir si tu peux constituer une Team de Pokemons qui tient la route !

Calculation Corrigé disponible : PHP