These are chat archives for Codewars/codewars.com/kata-solving-help

23rd
Nov 2017
linh279
@linh279
Nov 23 2017 16:02
Hello. Could anyone help me with this code pls? I got Server Execution error. But it worked fine in Repl (the online Editor). Thank you.
function dirReduc(arr){
var opposite = {
'NORTH': 'SOUTH', 'EAST': 'WEST', 'SOUTH': 'NORTH', 'WEST': 'EAST'};
return arr.reduce(function(dirs, dir){
if (dirs[dirs.length - 1] === opposite[dir])
dirs.pop();
else
dirs.push(dir);
return dirs;
}, []);
damjan
@dpolugic
Nov 23 2017 16:34
The execution server has been down all day for me. Probably doesn't have anything to do with your code : )
Fernando Balandran
@kodaman2
Nov 23 2017 16:42
Same here, just tried submitting something it worked yesterday. And got server error. I don't know why the status page says all green. https://codewars.statuspage.io
Blind4Basics
@Blind4Basics
Nov 23 2017 22:03
Hi guys,
Someone to provide a bit of help on the "Builder of things" in python?
I currently have just on last problem with the can.speak part: the function provided use the name argument that has to be used actually with self.name instead and I do not find a way to achieve that.
I explored the function object and found a way to retrieve the arguments name that match a variable in a larger scope, but all the fields are "read only". I tried to wrap the function in another one where I wanted to eval("{} = self.{}".format(varName)) but that failed...
Currently, the only way I manage to pass the test is by defining the variable name in the outer scope, but it really pains me... :/
Any input?
Thx
eval("{0} = self.{0}".format(varName)), of course
Blind4Basics
@Blind4Basics
Nov 23 2017 22:21
"defining the variable name in the outer scope", meaning by hand... really lame... xD
Fernando Balandran
@kodaman2
Nov 23 2017 23:30
Is Thing object defined in the preloaded section?
Voile
@Voileexperiments
Nov 23 2017 23:30
@Blind4Basics yes, that's the one ugly part about that kata
in JS you also have to do an ugly thing and it just screams ugly over the whole thing because of how the other parts are handled