-
-
Notifications
You must be signed in to change notification settings - Fork 531
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
Added Palindrome in Kotlin #2080
Conversation
Algorithm to check if a number is a palindrome or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't currently support palindrome, but we're open to including this if we can get it documented. Let me know if that's something you want to do!
Sure. I'll do that. Let me know where to document it. |
Check out this repo: https://github.com/TheRenegadeCoder/sample-programs-website You'll want to create something that looks like one of these: https://sample-programs.therenegadecoder.com/projects/ |
I have done that and made a pull request. You can check it at TheRenegadeCoder/sample-programs-website#349 |
Also change Long to Int
Cool! Now we have the specification, let's get some tests going. There's a bit of a dependency in our way at the moment. See #2186. That said, we can add the test file here: https://github.com/TheRenegadeCoder/sample-programs/tree/master/test |
I'm sorry I don't get you quite well. Should the test be in python? As I can see all the test files are written in python. |
Yes! But the test files are more or less copy-and-paste. You should be able to copy binary-search.py and reuse most of it. |
Okay I'll go ahead and try that. I'll let you know if I'm done. |
This is getting very difficult for me as I have no knowledge in python. |
No worries! I can give you a rough idea of what you need to do. First, I'd copy the contents of the binary search test. |
Then, replace BinarySearch with PalindromicNumbers. |
Then, at the top of the file, you should see these:
|
These are the tests. You need to replace these tests with the one's you wrote. For example, the first invalid test looks like this:
You can replace it with this:
|
I have finished editing the test file. You may check and let me know what else I need to do please. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good so far!
After this, you'll need to update both of these: |
Co-authored-by: Jeremy Grifski <jeremy.grifski@gmail.com>
Co-authored-by: Jeremy Grifski <jeremy.grifski@gmail.com>
Co-authored-by: Jeremy Grifski <jeremy.grifski@gmail.com>
Co-authored-by: Jeremy Grifski <jeremy.grifski@gmail.com>
I have made both updates |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! The only issue is the program you wrote will fail your own tests. We don't have a way to prove that just yet because someone is currently adding Kotlin testing.
Okay. So what do I do now? |
Update the Kotlin script to match your tests. Then, we're stuck waiting on #2186. Though, I'm not against merging this and letting that pull request solve the issue. |
I have fixed that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure your program matches your tests, but we'll go ahead and merge it for now. When Kotlin testing is implemented, we'll clean things up.
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.
Complete the Applicable Sections Below
Find which section best describes your pull request and make sure you fill it out. To start, let us know which issue you've fixed.
Code Snippets
Added/Updated <Sample Program> in <Language>
formatTesting
Added/Updated <Language>/<Project> Testing
formatNotes
Feel free to describe what you added or updated.