• Hey mate, this is not an issue with the kata.

    You need to ensure that your digits match those specified in the description precisely.

  • I am not sure what I am doing wrong. On my IDE using the test provided input I output correctly. When I run it here sample tests 1 & 3 pass while 2 does not. I am guessing it has to do with the use of /n vs my """ in the display but I am too new to know better. Any help you can provide will be greatly appreciated.

    baseDisplay = """|  ###  |  ###  |  ###  |  ###  |  ###  |  ###  |
    | #   # | #   # | #   # | #   # | #   # | #   # |
    | #   # | #   # | #   # | #   # | #   # | #   # |
    | #   # | #   # | #   # | #   # | #   # | #   # |
    |       |       |       |       |       |       |
    | #   # | #   # | #   # | #   # | #   # | #   # |
    | #   # | #   # | #   # | #   # | #   # | #   # |
    | #   # | #   # | #   # | #   # | #   # | #   # |
    |  ###  |  ###  |  ###  |  ###  |  ###  |  ###  |"""
    
    def makeBlank(txt, pos):
    	x=0+(pos-1)*8
    	y=0+(pos-1)*8
    	var = list(txt)
    	var[x+3:y+6] = "   "
    	var[x+52:y+57] = "     "
    	var[x+102:y+107] = "     "
    	var[x+152:y+157] = "     "
    	var[x+202:y+207] = "     "
    	var[x+252:y+257] = "     "
    	var[x+302:y+307] = "     "
    	var[x+352:y+357] = "     "
    	var[x+403:y+406] = "   "
    	return "".join(var)
    def make1(txt, pos):
    	x=0+(pos-1)*8
    	y=0+(pos-1)*8
    	var = list(txt)
    	var[x+3:y+6] = "   "
    	var[x+52] = " "
    	var[x+102] = " "
    	var[x+152] = " "
    	var[x+252] = " "
    	var[x+302] = " "
    	var[x+352] = " "
    	var[x+403:y+406] = "   "
    	return "".join(var)
    def make2(txt, pos):
    	x=0+(pos-1)*8
    	y=0+(pos-1)*8
    	var = list(txt)
    	var[x+52] = " "
    	var[x+102] = " "
    	var[x+152] = " "
    	var[x+203:y+206] = "###"
    	var[x+256] = " "
    	var[x+306] = " "
    	var[x+356] = " "
    	return "".join(var)
    def make3(txt, pos):
    	x=0+(pos-1)*8
    	y=0+(pos-1)*8
    	var = list(txt)
    	var[x+52] = " "
    	var[x+102] = " "
    	var[x+152] = " "
    	var[x+203:y+206] = "###"
    	var[x+252] = " "
    	var[x+302] = " "
    	var[x+352] = " "
    	return "".join(var)
    def make4(txt, pos):
    	x=0+(pos-1)*8
    	y=0+(pos-1)*8
    	var = list(txt)
    	var[x+3:y+6] = "   "
    	var[x+203:y+206] = "###"
    	var[x+252] = " "
    	var[x+302] = " "
    	var[x+352] = " "
    	var[x+403:y+406] = "   "
    	return "".join(var)
    def make5(txt, pos):
    	x=0+(pos-1)*8
    	y=0+(pos-1)*8
    	var = list(txt)
    	var[x+56] = " "
    	var[x+106] = " "
    	var[x+156] = " "
    	var[x+203:y+206] = "###"
    	var[x+252] = " "
    	var[x+302] = " "
    	var[x+352] = " "
    	return "".join(var)
    def make6(txt, pos):
    	x=0+(pos-1)*8
    	y=0+(pos-1)*8
    	var = list(txt)
    	var[x+56] = " "
    	var[x+106] = " "
    	var[x+156] = " "
    	var[x+203:y+206] = "###"
    	return "".join(var)
    def make7(txt, pos):
    	x=0+(pos-1)*8
    	y=0+(pos-1)*8
    	var = list(txt)
    	var[x+52] = " "
    	var[x+102] = " "
    	var[x+152] = " "
    	var[x+252] = " "
    	var[x+302] = " "
    	var[x+352] = " "
    	var[x+403:y+406] = "   "
    	return "".join(var)
    def make8(txt, pos):
    	x=0+(pos-1)*8
    	y=0+(pos-1)*8
    	var = list(txt)
    	var[x+203:y+206] = "###"
    	return "".join(var)
    def make9(txt, pos):
    	x=0+(pos-1)*8
    	y=0+(pos-1)*8
    	var = list(txt)
    	var[x+203:y+206] = "###"
    	var[x+252] = " "
    	var[x+302] = " "
    	var[x+352] = " "
    	var[x+403:y+406] = "   "
    	return "".join(var)
    
    def segment_display(num):
    	number = list(str(num))
    	digital = baseDisplay
    	if len(number) < 1:
    		for b in range(1,7):
    			digital = makeBlank(digital,b)
    		return digital
    	startPosition = 7-len(number)
    	for b in range(1,7-len(number)):
    		digital = makeBlank(digital,b)
    	for z in range(0,len(number)):
    		if number[z] == "1":
    			digital = make1(digital,startPosition)
    		elif number[z] == "2":
    			digital = make2(digital,startPosition)
    		elif number[z] == "3":
    			digital = make3(digital,startPosition)
    		elif number[z] == "4":
    			digital = make4(digital,startPosition)
    		elif number[z] == "5":
    			digital = make5(digital,startPosition)
    		elif number[z] == "6":
    			digital = make6(digital,startPosition)
    		elif number[z] == "7":
    			digital = make7(digital,startPosition)
    		elif number[z] == "8":
    			digital = make8(digital,startPosition)
    		elif number[z] == "9":
    			digital = make9(digital,startPosition)
    		startPosition += 1
    	return digital
    
  • maybe it sounds weird, but I ran my prog on IDLE and everything is OK, however here I didn't pass any test

  • I see what you mean; myjinxin's is indeed more difficult. Marking issue resolved.

  • errr... I'd tend to somewhat disagree about the one you linked, since in myjixin's kata, the size is varying while it's not the case here. So the present one is clearly an easier version of the other, but not really a duplicate, imo (the simplest way to solve the present one will never solve the other, for instance)

    (but again, there might exist an "unfindable" python kata which would make the present beta an exact ducplicate...)

  • It's a good kata, but unfortunately been done before. Resolving question as it's actually an issue.

  • It's a decent kata, but unfortunately a duplicate: https://www.codewars.com/kata/59cc4c5aaeb284b9a1000089

  • Didn't find that one when I went digging around for similar Kata sadly.
    I did find: https://www.codewars.com/kata/52a7099f8a4d9604bb000472 (which is focused around printing the 7bit number that lights the individual segments.)

  • I believe there is another in python (I already solved something like that)

  • Resolved

  • Added examples of all combinations.

  • Yep, that was an oversight on my end. Fixed it.

  • Sample tests cannot be run.

  • The shape of each digit should be in the description, not only in the sample tests.

  • Loading more items...