8 kyu
Function 1 - hello world
108,275 of 274,904ineiti
Loading description...
Fundamentals
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
This comment has been hidden.
This comment has been hidden.
The tests do not check stdout, they check what your function returns. So, printing anything is completely ignored by the tests.
it is because you did not create a function, so there is no function to return the "hello world!" message
This comment has been hidden.
I've never had it this hard before
I guess one can just generate an array of random char, and keep submiting it until it works two times in a row huh?
i was write.but it is giving error
your code is not right because you are expected to write a function, instead of a string
This is usually provided for you, so it's super helpful to get practice writing it.
This comment has been hidden.
why ? it is this rigth answer, if it returns <function greet at 0x7fe569221d30>
def greet(): return "hello world!"
print(greet)
You are calling the function itself -->
print(greet)
, which displays the memory address of it. By calling the invoked function -->print(greet())
(Note the parenthesis), you may see the output -->hello world!
as i test my solution it says i passed all tests but when i attempt it gives this error
Traceback (most recent call last): File "/workspace/default/.venv/lib/python3.11/site-packages/codewars_test/test_framework.py", line 112, in wrapper func() File "/workspace/default/tests.py", line 15, in _ test.assert_equals(greet(), "hello world!", "Greet doesn't return hello world!") ^^^^^^^ TypeError: greet() missing 1 required positional argument: 'f'
That's because the tests call your function without arguments and you wrote a function with an argument.
This comment has been hidden.
see there. In most katas, you have to write a function that returns a value (instead of merely printing it, tests dont care about what gets printed to the console). In your second code sample, you merely print a value at the top level, this will fail because the tests expect you to provide a function called greet that returns a value.
its broken
function greet() { console.log('hello world!'); } greet('hello world!');
Is there any problems with my code, the test results seemed to log 'hello world!', but it says 'unexpected undefined to equal 'hello world!'
https://docs.codewars.com/training/training-example#writing-a-solution
https://docs.codewars.com/training/troubleshooting#.print-vs-return
return a "hello world!", not print it.
getout the !
Hardest task in my life
This comment has been hidden.
Because the tests call your function like this:
greet()
and you get this error:Create a function without parameters.
For convention's sake, it should be "Greet()" not "greet()".
Why is this helloworld so complicated? I guess i skipp it, creativity comes later
It really isn't complicated. You don't need the
main
method.Greet doesn't return hello world!: None should equal 'hello world!' what is this help me anyone!
Time: 459ms Passed: 1Failed: 1Exit Code: 1 Show All Test Results: Log hello world! Greet function Testing that it returns hello world! Log hello world! Greet doesn't return hello world!: None should equal 'hello world!'
Your code is not exactly what Codewars wants it to be. See if this article helps.
Been using Hello with cap H...case sensitive this thing
This is a nothingburger kata. I'm here to learn and practice, not try to be cute. I'm skipping it.
I wasted so much time because I thought we had to print the satement.
omg... I did it... at random...20 mins... omg
I solved this kata for 20 minutes :DDD
I'm here to train my fundamental coding skillz, not to showcase flourishes that I don't possess yet. To hell with "creativity"; it can wait until later.
Please tell me why the code doesn't work. It gives this error. main.cpp:9:5: error: conflicting types for 'main' int main(int, const char *[]) { ^ ./solution.cpp:7:5: note: previous definition is here int main() { ^ 1 error generated.
The code works in Visual Studio.
Because you don't use a main method here in your code, just use the initial code and fill out the method that's already written.
Thank you!
My first kata... I just can say: Hello Codewars!
1
Guys im not sure what am I doing wrong...
In IDE all works fine, and result fine, but im getting error:
greet() (no value) used as value
You must provide more helpful information to get interesting answers to your problem:
Refer to this documentation for further help: https://docs.codewars.com/training/troubleshooting
Respectfully, this kata should be removed. I almost skipped this one because I felt like I was stealing points.
A program that contains a 2D array of size 4x5 with direct numbers. What is required is to print each row in the array, then sum the elements within this row, and print the sum of all the elements at the end(c language).
uh, what ?
Ask ChatGPT.
hhh
Oh, my God! How did this get through the vetting process? It's so simple, anyone can do it.
Of course it's simple, but that's not the point of this Kata. Some of the solutions are works of art.
Hello guys!
I've tried with C and the console return correctly "hello world!". But I can't attempt it, what can I do now? Because I'm newbie in codewars.
Read this: https://docs.codewars.com/training/troubleshooting/#expected-the-same your function should return the string, not print it to the console. Not a kata issue.
Read this: https://docs.codewars.com/training/training-example and this: https://docs.codewars.com/training/troubleshooting too.
Brainfuck Translation (author gone)
Already rejected
Fortran Translation
i can attempt the question but can't submit it , how can i submit it ?
OP solved it, closing
STDERR: Traceback (most recent call last): File "/workspace/default/tests.py", line 2, in from solution import greet ImportError: cannot import name 'greet' from 'solution' (/workspace/default/solution.py)
Don't change the function's name. Rename it back to greet or click Reset and start over. Not a kata issue.
This comment has been hidden.
console.log()
returnsundefined
, return the string as the instructions say. Next time mark your post as having spoiler content, read this: https://docs.codewars.com/training/troubleshooting/#post-discourseHi Chrono79, how do i return the string? Sorry i didn't know about the spoiler
Simply remove the
console.log
.thank you
The instructions on this as a first time codewars user are very unclear. I spent about 20 minutes figuring out why my main() was not calling greet() and why I couldn't predeclare my greet() function etc. The description needs to clearly state that you aren't writing a working c++ program here and you're literally only writing a function that returns a string.
Not very beneficial as a learning tool off the bat for me.
I can't see how can you make that more clear. It's like that on every kata, you only create a function (except a few ones where you need to write a regular expression only for instance). You don't use a main method here on Codewars.
See the initial code for C++:
As I said I'm a beginner to codewars, this was literally the first kata I ever looked at, and as someone who has just spent a week of learning C++ by having to write functioning programs it wasn't clear how this worked. Now that I know all of these are just basically working on a single function that's fine, but it was confusing for me as to how it worked.
You'll get used to it in no time, have fun.
I am using TS
TSError: ⨯ Unable to compile TypeScript: test.ts:2:23 - error TS2306: File '/workspace/default/solution.ts' is not a module.
2 import { greet } from "./solution"; ~~~~~~~~~~~~
you have not followed all of the directions correctly
not a kata issue
I also have the same error in don't know why
For these that can not pass the test, the function is call "greet" with two e not "great".
bro i kept doing print() instead of return LOL
same, except I was trying to do it with a macro defined for every character
I have never felt like more of an idiot lmao. I thought I was going crazy
Traceback (most recent call last): File "/workspace/default/tests.py", line 2, in from solution import greet ImportError: cannot import name 'greet' from 'solution' (/workspace/default/solution.py)
not a kata error: you have changed the function name
greeting
should begreet
This comment has been hidden.
Please don't post solutions in discourse. See https://docs.codewars.com/training/troubleshooting#post-discourse
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
Why is it not 1kyu?
Because 8 kyu is the lowest, they count down and this only requires you to return a string.
Good
In c++ test file doesn't work
It works fine, your code is wrong:
Your function prints, it doesn't return. Not a kata issue, please read this: https://docs.codewars.com/training/troubleshooting/
Hello World
C# error: tests/Fixture.cs(10,42): error CS7036: There is no argument given that corresponds to the required formal parameter 'test' of 'Kata.greet(string)'
although parameter as string is given (code works outside this test).
Is this for real? Why it's so HARD!!
on gawddd!
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
Please read this: https://docs.codewars.com/training/troubleshooting/#expected-the-same
OP solved it, closing
Very fun kata. Its fascinating to see what others come up with. Good job!
I'll try to over-engineer this as much as possible
This comment has been hidden.
Your function prints
'hello world!'
, but it should return instead. Here's an article explaining how the codewars trainer works. It's in python but the same concepts apply to JS.This comment has been hidden.
@Aadarsh Raj: Please don't post solutions in Discourse.
pls i dont understand this thing
Do not despair, believe in yourself
Using both traditional and arrow function testings in JS, I keep receiving an error on the return. I took both functions and ran them in VS Code, and they both execute fine. Am I not understanding the instructions?
This comment has been hidden.
So, the task here is to create the Goldberg machine? (I mean the hardest "Hello, World!" possible)
lmaooo yes
You know you suck at c# when you can't even do the first one
My brother in Christ this isn't even C#
Traceback (most recent call last): File "tests.py", line 3, in from solution import greet ImportError: cannot import name 'greet' from 'solution' (/workspace/default/solution.py)
"Works" for both 3.8 and 3.10
Hi @a_f_kay - currently you don't have a function named
greet
in your code, that is why you are getting such an error message.You need to have something like
def greet():
and it must return your result, rather than justprint()
to console, as you are currently doing.(I agree that the Example code, which is given without such a function, can be confusing)
I don't get it. What I expect to be something like; If (function.greet = true) { print("Hello world"} } But it's not close to right
Your function doesn't return, it's just printing. Also, check which language you're using.
What's the purpose of the Sample Test? Is that something that interracts with the solution, like a componant to the code? or is it just an example it has no interaction with?
You've missed the exclamation point.
Don`t work on Rust. I have error every time.
I imagine you found it by now but just for the people who are struggling and think it won't work. It DOES work on Rust.
This comment has been hidden.
Not a kata issue, read this: https://docs.codewars.com/training/troubleshooting/#expected-the-same
Had it right the first time... But didn't have the exact lowercase spelling...
This comment has been hidden.
you named your function
kata
instead ofgreet
. not a kata issueThis comment has been hidden.
You don't use
main
here in Codewars. Also:Returns, not print.
A problem with your code is not a kata issue. Read this, please: https://docs.codewars.com/training/troubleshooting
fix your kata
Nice kata, thanks !
test file has issues.
No, it works fine. It's
greet
, notGreet
.Not a kata issue.
i cant understand why it happens this all the time in every exercise i do. same answer but is wrong?
*Correct return-value? Log 'hello world!' expected undefined to equal 'hello world!'
https://docs.codewars.com/training/troubleshooting/#.print-vs-return
it says it expected 'hello world' to be equal to 'hello world' i don't understand
put the exclamation at the end
This comment has been hidden.
As Oozaku mentions in her message below, the template is broken.
(provide greet)
is missing. This is causing the error.duplicate of this issue
Python Issue: The Attempt does not work although my Test was successfull. I had to add the "hello world!" to the function in the test - is there something missing when executing the Attempt?
Your code is wrong, it doesn't return
"hello world!"
. It just returns the string passed to it. Not a kata issue. Please read this: https://docs.codewars.com/training/troubleshooting/Just getting started with Code Wars. Vey enjoyable. They want the output to match up exact. Annoying. lol
This comment has been hidden.
Remember to
return
the result and not print it! read this for more infoThis comment has been hidden.
Please use a spoiler flag when you post code somewhere so that users who didn't solve the kata cannot see it (I put the flag on for you this time). Best practice are what users voted like best practice, very often they are not good practice at all. You should not pay too much attention to this (but vote for what you think is best practice, if you have some idea ;)).
Thanks for your answer! But I expect receive explanation about usage std::string() constructor before make return.
This comment has been hidden.
Just do what is written in the description...
Create a function called "greet", which returns "hello world!".
Thanks, but on CW, you write actual functions/methods, meaning you have to return a result. Do not write it to the console (i.e. "cout << "hello world!"; return 0;"); this will result in failure.
TypeScript version of the excercise seems to be broken.
Seems okay. It what way exactly would you say it's broken?
the console made it seem like there was an issue with the ./soultion import but ofc It was just something wrong with my code
void greet(String message) { print(message); }
greet("hello, world!");
i run this code and does not work. what do you think is the problem?
This comment has been hidden.
Hi,
On CW, you write actual functions/methods, meaning you have to return a result. Not to write it to the console.
See here for some help about debugging: https://docs.codewars.com/training/troubleshooting
cheers
you should return, not print
This comment has been hidden.
I had a lot of fun with this one. Thank you!
This comment has been hidden.
Did your "attempt" results have any red text in the output? If you passed all the tests when you click "attempt" then the output should display all green messages and the "attempt" button will become "submit".
Log is what gets printed to the output stream so maybe you printed the string rather than writing a function to return it?
This comment has been hidden.
Make sure your function is called greet.
This comment has been hidden.
You don't use main here. Also, your function should return the result instead of printing it.
This comment has been hidden.
it's a scam I managed to display "Hello Wolrd!" but does not validate my challenge who can check my code please?
Should be "Hello World!", at least in NASM.
This comment has been hidden.
Sorry, I don't know NASM, I only pointed out the difference between what you wrote and what was expected.
"Hello Wolrd!" vs "Hello World!"
@Hibbooxx: you should return "Hello World!". Also, do not modify
ebx
.it displays log: Hello World but does not validate:/
eax
must point to the result, do not useint
. Your function must finish withret
.should I make a ret on which register?
Just
ret
, with no arguments. The tests will automatically checkeax
points to the right stuff.why can't I use stdout.write? p.s. this is for javascript
In Javascript you can use
console.log
, see this documentation: https://developer.mozilla.org/en-US/docs/Web/API/Console/logI know you can use console.log, but it is unprofessional. Usually stdout.write is used, but I am unable to use it in codewars for some reason
You could try
process.stdout.write("Hello World\n");
it works just fine. Could you elaborate why usingconsole.log
is unprofessional?that works, thanks. Console.log is deemed to be unprofessional in development because one they bloat your js code, and two, some browsers do not have a console object; this would mean the browser would not function and most likely crash. That's why it is seen as unprofessional.
This comment has been hidden.
old and very deprecated
C89
feature, but still compiles. variables, parameters and return types are assumed to beint
if they are not explicitely typed. It's extremely bad practice, (and it's even forbidden byC99
onwards) but several compilers just emit a warning (likely not to break ancient programs).so your function is returning an
int
, even though it should be returning a pointer to char. It still happens to work because the address of the string literal happens to fit in a 32-bitsint
;)
Racket's template is broken. You should add
(provide greet)
.ah.
That must be my mine is working. I got the "must return" part.
fixed
This comment has been hidden.
Please see this bullet point: https://docs.codewars.com/training/troubleshooting/#.print-vs-return
Thanks, I fixed it now.
too easy ezezezezezezezezezezezzezezezezezezezezezezezezezezezzezezezezezezezezezezez
Nice idea!
I initially just did the textbook hello world, but something made me come back and do it in a more interesting way.
COBOL needs to have hello world program as well
hence the translation
This comment has been hidden.
Remove the print. Your code is causing the error, so it's not a kata issue. Google the error.
Ha so simple... it doesn't ask that I print the function. Thanks
python: Traceback (most recent call last): File "tests.py", line 3, in from solution import greet ImportError: cannot import name 'greet' from 'solution' (/workspace/default/solution.py)
Have you created a function named greet?
Oh.. thanks, I found a solution
Be sure that when you're writing the solution for PowerShell (or any other language) that you're returning and not writing to the host.
This comment has been hidden.
In C, it takes intermediate concepts, like knowing about pointers to complete, so I think it doesn't match the level here
the function needs to return a string to be in accordance with the other translations. i agree that the exact definition of a "string" in C is rather ambiguous (could be a malloced string, a global or static char array, a pointer to a string litteral ...) however, since the returned pointer is not freed in this kata, the user has several possibilities and it should be possible to come up with a solution after some research, even for a complete begginner
C (and NASM or FORTRAN) versions are almost always harder than other languages, but that's unavoidable when you choose to program in a low level language
I'm learning, I solved in my pc with println and it didn't give any error, here the codewar the tip is: don't use println
This is not a kata issue, read this: https://github.com/codewars/codewars.com/wiki/Troubleshooting-your-solution
just wanted to say to the people that didint know that you have to name your function greet for it to work, unless you know how to make it work without naming it greet
How do I submit my solution?
this function requires that you return a string
where do yuo type in the code?
Click on "TRAIN" or "TRAIN AGAIN"
cheers, jesus christ, i failed the first test
?
just joiking re TRAIN button howeevr, IM nto quite undrestanding: passed 1, failed 0, howeevr still it got error? I passed or not?
No, you have not passed yet.
When you think you've finished writing code, then click on "ATTEMPT".
This will check the correctness of your code against more test cases.
ok, cheers I figured there is a number of assumptions and the system show how many you met / did not meet, ok thanks, passed the second code, first attempt
The worst kata ever!
This comment has been hidden.
Your function should return the result, not print it to the console, read this: https://github.com/codewars/codewars.com/wiki/Troubleshooting-your-solution
You also don't need to create a main method.
Prolog version is a bit confusing. Assertion: "hello world!"=='hello world!'
C# translation (https://www.codewars.com/kumite/5f1b2e8c889c640018936c62) C# addes! :D
Sorry, a little OCD thing of mine. In C# the standard is for methods to be capitalised. So greet() should instead be Greet(). Thank you.
oh thank you so much, I will fix it now!
Don't approve -> did you even read the task. It's hello world not
"Hello, Jack"
.Correct, thnx! fixed!
You should specify the name of the function. I've chosen its name as hi and it didn't work. After reading the sample test I figured out chaging the name of my function to greet works.
It's already in the instructions. Read them again.
And this is the initial code in javascript:
sorry. You are right lol. I didn't see it.
In C++.. i get this error;
Expected: equal to hello world! Actual: hello world!
Is there a way to view source code so i can dig a little deeper? Thanks
This comment has been hidden.
Hi. First time doing a Kata as a member. How do I submit this for review from others and have this record as a completed Kata? I'll keep poking around here looking for a solution in the meantime. Thank you, Dwight
Hi, welcome to Codewars. When you submit a correct solution it is saved on the solutions page for that kata. At that point coders that have solved the kata will be able see your solution amongst the others. That is a great place for you to do review other people's code, make comparisons, and do some study.
Hi... Thank you for responding! Very much appreciated.
So I wrote some code and it passed the Test. But I don't see the Submit option. I only see SKIP, UNLOCK SOLUTIONS, DISCUSS, RESET, TEST, ATTEMPT. Can you tell me what I need to do to see the Submit button or option?
TEST = tests your code against the Sample tests ATTEMPT = tests your code against the Final tests, once your code pass all these, the button will change to SUBMIT. Make sure you clean/refactor your code before submitting.
This comment has been hidden.
Nevermind! I found the workaround. Thank you everyone who helped me get passed my first kata!!!
This comment has been hidden.
This comment has been hidden.
Function 'greet' doesn't require arguments. string greet() { //your magic }
Might be because H and W are capital in your string-Case sensitive maybe (not sure though). Also what eb110 said - arguments are not required here.
This comment has been hidden.
This comment has been hidden.
As the description mentions => you have to return something...void returns nothing, try to solve other katas to understand how the semantics should to looking for - function main is redundant
Also delete that main function you wont need it
Cant solve the problem. any suggestions guys?
Explanation - Create a function named as greet that would simply return this string -> 'hello world!'. Print is optional here, return is mandatory to pass tests. Could answer better if you specify the problem you are having.
This comment has been hidden.
Return instead of printing.
Forget about describe, it and assert_equals, you don't need to define them. If you want to test your code in another environment, simply print the function call, like this:
print(greet())
return, not print
Thank you so much. !!!!
I think this is too easy in some languages. The test that codewars gives you to get an account is actually harder than this
Brainf translation available!: https://www.codewars.com/kumite/5e4b61b849e8ae00343bb744?sel=5e4b61b849e8ae00343bb744
Rejected some time ago
CFML Translation!
Approved.
Hi guys. I can’t do the task. Tell me where can I see the answer to understand this problem?
return not alert or log
Inside the trainer, you can click Unlock solutions button (just not for all kata tho, that depends on your current kyu level).
)))) Hello! How did you guess what I’m writing alert? ))))
I already found the answer. When I saw the answer, I wanted to hit my head against the wall - because I could solve it myself)) But my knowledge of what is still very small from this I decided to solve problems in order to learn and become smarter.
Thanks, I already found)
just saw your attempts))) Be patient.
That's okay, VladimirChernovv. I have felt like that at least 100 times!
Swift translation available:
https://www.codewars.com/kumite/5e2d43e3487459002f45f867?sel=5e2d43e3487459002f45f867
Please let me know if there are any issues.
The Go translation tests for hello world instead of hello world! with an exclamation point, contrary to the description.
Fixed.
Prolog translation kumited! Please Accept :smile:
Approved.
Wait a sec... Can't believe I missed it.
Assertion: "hello world!"=='hello world!'
Why atom? The description implies string.
to easy
One of the toughest question of century!
PHP Class './run' could not be found in '/home/codewarrior/run.php'.
I cannot reproduce this - and there are 629 solves. Are you trying to run sample tests or what? There aren't any sample tests...
I just added sample tests. Try again after resetting.
Many languages still have no sample tests: Groovy, Java, Javascript, Julia and some others.
But we don't even need sample tests, really...
I'll add them. This is poor experience.
I wouldn't expect users trying to solve this kata (one of the easist on CW) to understand that you get error because the sample tests are not written. This is just poor experience for no gain.
Yes, I was referring to sample tests.
Some languages have no initial code, should we add it too?
Yeah, can you do that? I added sample tests.
Sure.
Sorry, if the point of this kata is to let users declare the function, maybe just a comment mentioning that is better. This kata is really inconsistent :(
Ok, I'll remove the function declaration of the ones that already have it then.
Didn't want to start a brawl, just pointed that out, because beginners can be confused because of that. Regards, Luke.
Don't worry, translations were really inconsistent, so they'll have to be standarized some day. Done for all, except for Haskell and NASM.
Taken me ages, but finally managed to get my genetic algorithm to spell "Hello World!" in under the maximum execution time (12s). Was fun though.
Finish in bash to see, I'm unashamedly proud of it XD.
C++, Factor, Racket, Reason, Elm, PureScript, and TypeScript translations.
'all approved some time ago'
No code template and no test for PowerShell
There is no powershell test
Sample tests don't seem to exist for C# version.
The Sample Test is empty (when solving in R). A novice friend was very confused why her correct solution did not work, when running the sample test. As this is an 8 kyu kata, she was not yet able to write a sample test herself. Please add the test cases to R:
test_that("Test for hello world", { expect_equal(greet(), 'hello world!') expect_equal(paste('someone', greet(), sep=" "), 'someone hello world!') })
This comment has been hidden.
Hi, first of all, congrats your solution is correct, you could just hit attempt!
The sample test is just a template you would need to modify to actualy test the code. Which IMHO is too much of an ask for a level 8 kyu. If you replace the entire code in 'Sample Test' with the following, it will (crudely) test your proposed solution.
describe "Solution" do it "Test Suite: This test for 'hello world!'" do Test.assert_equals(greet(), "hello world!", "Error Message: This should output 'hello world!'") Test.assert_equals("someone " + greet(), "someone hello world!", "This should output 'someone hello world!'") end end
Explanation (in case you are interested): The string starting with 'Test Suite' states the name of your entire test suite. Each line of Test.assert_equals should test one aspect of your test suite (being one test case). Each test case consists of one 'test step' (the actual result), the expected result and the message being displayed in case of an error.
Shell:
greet
function or it's just printed.Fixed.
Why should it be enforced, though>
Initial solutions are empty in other languages, which means that users are supposed to define functions themselves and that's what he kata is about.
You write in description should return "hello world!" and expect "hello world" (without '!'). This is an error in my eyes.
Not anymore, but next time you report a problem, state the language you're talking about, it was a problem with C# translation, other languages are ok AFAIK.
Very poor description.
ITS SO HARD
This comment has been hidden.
Add sample tests to all languages.
All languages have sample tests now ~~
There are really at least THREE (3) issues here:
the solutions count shows that at least 8 codewarriors have solved the C version of this kata, yet only two are visible, only one mention of duplicates or similar codes described as existing.
This message is shown in the solve window:
and yet this translation was just approved by
Unnamed
(translator for several other languages of this kata)...___i
was given credit for MY solution... he had made a partial attempt as the C translator, but the only reason I worked on this was that that___i
's code was wildly incomplete (no solution set-up, no sample test cases) so I thought I was good to go for translating this kata ----> as this attempt had reviewed bySouzooka
and deprecated six months ago.I have solved it in C but not submitted final solution, now the count is 9, can you see me in the list of C solvers?
Sometimes happens, don't know why or how to fix it.
I guess that happens when you're not the original translator.
No, I see only
__i
at the bottome, thenUnnamed, potemkine
above thatCan you suggest someone who possibly can?
aaagh!
thank you very much for your assistance
None of these were issues really...
@Chrono79 thanks again
@FArekkusu I would have thought at least the fact that warrior codes were not showing up would be something... anyway, my mistake
So, the Go tests have "should return hello world 500 times"... I kind of want to see if I can fail that test. Like... write code specifically designed to pass other tests--but fail that one.
Maybe that is a Kata idea there?
This comment has been hidden.
Closing as it is not kata-related
This comment has been hidden.
There are no tests for PowerShell. It would be nice for the instructions to mention that you should just submit your answer and not try to run the tests if they're not going to be added.
Javascript
tried my code in repl.it and it works fine,
tried with hello world! and hello world but still errors
In PHP there is an error
Class './run' could not be found in '/home/codewarrior/run.php'.
I've just checked, everything works. You probably tried to run empty sample tests.
That's correct. Maybe it's worth doing a dummy sample test to avoid confusion.
greet is case sensitive, no "!" in hello world, hello world itself case sensitive, had to reset to remove the test cases and all the junk... Holy hell, what a mess.
C translation kumited
Review and approve.
C++ translation kumited
Review and approve.
'approved some time ago'
This comment has been hidden.
Im only used to python before this ;_;
@BenhaminKaufman :
This is logging it to the console and is working fine. You are supposed to return the value not print to console.
Jeez Im so dim
Trying this one with JavaScript and it just tells me my return-value is incorrect even though it matches the description. Tried it with and without the exclamation mark.
In javascript it want you to return
hello world!
In python it want you to return
hello world
In the discription both have been used.
Can someone fix them all?
Edit:
In ruby it's
hello world!
Fixed.
Test do not match description; instructions say to write "hello world!" not "hello world". Also there are no sample tests.
Fixed.
I updated description to be more clear on what exactly the return type and string should be since many people have noticed the description with "hello world!" to be confusing. I also added a
go
lang translation. (Suggestion tag means suggested edits)Tests do not match the description.
Python tests for
hello world
instead ofhello world!
Also, no sample tests.
Just because it's an easy one doesn't mean you should phone it in!!
I added a more clear description and 1 example test... Also added go translation. Can you approve the updates?
Fixed.
This comment has been hidden.
CW is different from most competitive programming sites: you're writing real code that are tested with real test suite. So you should return the result instead of writing the result to stdout.
Have fun on CW! :)
C# test is wrong. Testing "hello world" not "hello world!"
How sad; the description is actually wrong.
nice beginner kata..thanks
The very basic one is not working on Python3, tried all variations. upper case, with exclamation mark , without exclamation mark, etc.
This comment has been hidden.
Fixed.
The Python translation tests for
hello world
instead ofhello world!
with an exclamation point, contrary to the description.Came here to say the same.
Fixed
Your description has a mistake. Please, change it: instead of "hello world!" must be "hello world" - without exclamation mark!!!!!!!!!!!!!!!!!!!!!!
Moreover unit test expected and current values are switched (C# here).
The C# version violates the C# coding conventions. C# (or .NET actually) methods are written in Pascal case and the Assert call in the submission test has the parameters mixed up. I had to do a double take before I realised that the text actually expects "hello world" without exclamation mark.
Thank you! I was kind of going crazy on why my incredibly simple method was failing.
Yes, the instructions for C# probably need to be fixed. Or the test, either way.
CoffeeScript translation published.
i don't understand why the log always show "/HelloWorld.java:1: error: duplicate class: HelloWorld",no matter what i have written.
Instructions state that the expected return is "hello world!", however, test asserts for "hello world". Also, lower case? "Hello, World!" would be much better, however, I feel there could be some leeway, as in the test asserts for any variation, lowercase uppercase with commma without comma with exclamation without exclamation with minor typos etc.
Also, C# method should start with an uppercase letter, as in Greet instead of greet. Really. It should.
I'm so used to run the test first ... that I've failed this one:D Click Submit after you're done, no testing required (it will ended in error)
C# translation has the "actual" and "expected" assertation swapped. It also insists on "hello world" even though the instructions clearly state it should be "hello world!"
Same with the Python one, actually.
This comment has been hidden.
expected value is
"hello world!"
Still does not work!
they have the 'expected' and 'actual' values backwards.. it wants "hello world" (no exclamation point).
i can't pass too ,even i set it to 'hello world'
Hello person from two years ago. Lose the console.log! It only needs the return.
This comment has been hidden.
The instructions don't match the test condition that code must pass. "hello world!" vs. "hello world"
This was hilarious! Best fun ever to leaf through all the crazy submissions!
Hello,
I try to make this exercise but I never made any test-case. That was not mentioned in the CodeAcademy course.
Can anyone give me a clue how to make this work. I have figured out that the assert must look like this assert ( "", greeter) but when I enter this in the test I see only errors.
Roelof
it's very hard to answer you're inquiry fully wthout looking at your code.
I useually do not rely on the tests alone as often I can't tell where I may have commited a syntatic error, or even a logic one from wrting tests alone
for that I use the developer tools debugger
basically I take the code that I wrote and try running it there in the console. I also add a break point by adding the debugger; keyword in my code, which forces the debugger to come out and I get to step through my algorithm I wrote a small inextenssice post as a blog post
to learn about devtools check out codeschools free collaboration with google
This comment has been hidden.
This comment has been hidden.
Doing the basic one is easy. It's a lot more fun if you try and complicate things as much as possible ;)
Thank you Daddy!