Skip to content

Instantly share code, notes, and snippets.

@nware1066
Last active November 20, 2022 18:40
Show Gist options
  • Save nware1066/be3b758f666a296a1a54db588bb1e446 to your computer and use it in GitHub Desktop.
Save nware1066/be3b758f666a296a1a54db588bb1e446 to your computer and use it in GitHub Desktop.
Code Wars pseudo-code

The Code Wars site allows users to practice coding in the language of their choice. I have included in this gist the pseudocode for three challenges that I completed. I have included a brief explination of the challenge, as well as the steps that I felt would be useful in solving the problems

  1. Count the Monkeys

  • a number is passed as an argument; return an array including each number from 1 to the stated number.
  • assign a value of an empty array to a variable to hold the solution
  • create for loop to add 1 number to the array for each iteration (based on number provided in argument)
  • set for loop to begin count at 1, rather than 0
  • push count to array
  • return array
  1. Abbreviate 2 Word Name

  • a string of 2 words will be passed through as an argument, return the first initials of those words in capitial letters
  • change all letters to uppercase
  • split string into array with each word as an element
  • return the first index number of each element
  1. Is n Divisible By x and y?

  • three numbers are passed as arguments, determine if the first is divisible by the other 2
  • conditional statement requiring that x must be divisible by both the first and second # without any remainder (modulo)
  • return true or false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment