Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
I thought it would be an issue if codewars did something the language's native environment did not do, which is why I flagged it. Restating the solution I posted 5 months ago and not addressing the difference I pointed out between the environments makes it seem like we are discussing different things. I am not asking for assistance with a solution, I am pointing out that codewars added a leading space to an unitilized variable where powershell ise did not.
What i mean is that I do not know exactly, but I really doubt that it's an issue with runner or Codewars environment. If it were Codewars fault, then the space would be added always, and not only when the variable is uninitlized, right? I was able to fix your solution just by adding three characters to it. I added
= ""
and it worked.Having to choose between some mysterious bug in Codewars and an error caused by an uninitialized variable, I'd bet on the latter, or maybe some other thing I dont understand yet, like some syntax clash or something.
I checked some other solutions, and checked reference solution and checked your solution after my change, all of them work. Currently the only problem is with your solution, which contains some suspicious syntactic construct i dont exactly understand (because I'm too noob with Powershell), but seems to be a culprit and cause of your problems.
That is explained in my response from 5 months ago, and the issue is the space is added in codewars but not in powershell ise as shown in the image in the same response?
Your solution works for me if I replace line 5 with following:
$bestWord = ''
I do not know PowerShell too well so I do not know whether it's a problem with your solution and some kind of uninitialized variable, or with Codewars setup.
Do these replies actually notify anyone?
Not sure what your code is, but Xormias is saying that the kata requires you to build a return statement within the function as opposed to printing out the result to the terminal. Additionally many challenges may actually fail if you leave print statements in them due to the way they are built to be checked.
This comment is hidden because it contains spoiler information about the solution
Spaces don't appear out of nowhere, and compilers on CW aren't special either. Based on that, you'll have to make conclusions on your own.
I'd classify that as programmer's mistake, but that's just me. Of course, if you were able to reproduce this: by showing the input, your output, expected output, and the reason it's wrong - then it could become an actual issue. Given that powershell isn't that that popular, it's certainly possible, but there has to be proof and not just words.
Are issues only kata specific? I guess this is more towards codewars in general? If the the in-browser ide acts differently compared to a desktop ide...like adding spaces to a return value that was not added when compiled in vscode, what would that be classified as?
Your code not doing what you expect is not a kata issue. Please read this: https://docs.codewars.com/training/troubleshooting/
I appreciate the response, but just to be clear...youre saying do not use the "/" in repition? Or Dont use the "/" to divide?
Avoid this kind of operations:
a/b/c
when possible.This comment is hidden because it contains spoiler information about the solution
I am having a slight issue, I am using powershell and I have a working function but when I test it in the browser it is adding a leading space. The space doesnt appear when I test it outside the browser, and I verified by checking the length of the return string, I also tried adding trims in a few different places just to force it but it isnt catching it.