Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Longest Word Method in Ruby #4030

Closed
wants to merge 5 commits into from
Closed

Conversation

arcjun01
Copy link

@arcjun01 arcjun01 commented Nov 12, 2024

Congrats on taking the first step to contributing to the Sample Programs repository maintained by The Renegade Coder!
For simplicity, please make sure that your pull request includes one and only one contribution.

Please fill one of the sections below as applicable.
Please also add any other relevant information to the Notes section at the bottom.
You may delete or just ignore any other sections.
For more information please refer to our contributing documentation

I Am Adding a New Code Snippet in an Existing Language

Other Notes

This pull request adds a longest-word method, which calculates the length of the longest word in a given sentence. This method is a practice exercise for learning Ruby - focusing on string manipulation, array handling, and iteration.

Code Summary:

  • Splits a sentence into an array of words
  • Iterates each word to determine the length
  • Returns the length of the longest word

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @arcjun01! Thanks for contributing to this project! We are a rather small team, so it may take some time to process this request. In the meantime, there are several ways you can make yourself a part of The Renegade Coder community. For instance, you can:

Thanks for your help!

Comment on lines +19 to +28

# Test and Output
sentence = "Swiftly running foxes"
output = longest_word_length(sentence)
puts "Longest word length: #{output}"

# Test 2
sentence2 = "Intricately interwoven \nphilosophical contemplations"
output2 = longest_word_length(sentence2)
puts "Longest word length: #{output2}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this. We already have tests in our workflow. Also, please refer to the project infomation for details on the requirements. The program is supposed to take a single command-line argument.

@rzuckerm rzuckerm added enhancement Any code that improves the repo longest word See: https://sampleprograms.io/projects/longest-word/ labels Nov 14, 2024
@rzuckerm
Copy link
Collaborator

rzuckerm commented Dec 2, 2024

@arcjun01 Are you planning on doing any more work on this PR? If not, please close it.

@rzuckerm
Copy link
Collaborator

rzuckerm commented Dec 9, 2024

Closing due to inactivity

@rzuckerm rzuckerm closed this Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Any code that improves the repo longest word See: https://sampleprograms.io/projects/longest-word/
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Longest Word in Ruby
2 participants