6 kyu

T.T.T.31: Chinese poetry and calligraphy(中国诗词与书法)

Description
Loading description...
Puzzles
Games
  • Please sign in or sign up to leave a comment.
  • ejini战神 Avatar

    @myjinxin2015可谓是编程界中的诗仙啊 ~~

  • Unnamed Avatar

    Unicode has ideographic space character, U+3000, here: " ", it has the same width as CJK characters (although it looks thin here in Codewars in my Firefox with whatever font it is).

    [
    ["层","千","河","白"],
    ["楼","里","入","日"],
    [" ","目","海","依"],
    [" ","更","流","山"],
    [" ","上","欲","尽"],
    [" ","一","穷","黄"]
    ]
    
    • 8fdafs2 Avatar

      Thanks for the knowledge. I never noticed that there exists a wide range of Unicode Whitespaces (https://en.wikipedia.org/wiki/Whitespace_character#Unicode) However U+3000 also looks thinner in my sublime (w/ Source Code Pro font). Where can I look for the width information?

    • Unnamed Avatar

      I've checked font coverage for U+3000 by BabelMap and it turns out this character is absent from pretty much all widely used European fonts excluding Arial Unicode MS. I think I installed some CJK font pack at some point and, besides, Code2000 and unifont. The latter two are always nice to have in case you come across some rare characters on the net.

    • myjinxin2015 Avatar

      I think to use two spaces is more easier than U300. In fact, I've use this(full-width space) in some of My other katas.

  • smile67 Avatar

    Surely next time i'm ready to travel to China;-)... Good one, not as good as "Mr. smile67", but good:-)...

    • myjinxin2015 Avatar

      Don't expect me to release the complex Kata every time, I will also release some 8kyu kata (or 9 kyu 10 kyu...), you will soon find them ;-)

    • myjinxin2015 Avatar

      Two days ago to see a news, a Chinese tourists traveling in Germany, stay in the refugee camp for a few days, and received the relief money. I think, Germany is really so nice and so funny, I also want to go to germany ;-)

    • smile67 Avatar

      9/10kyu? Are you able to produce such easy katas, i'm not sure;-)? But i think you have enough good katas to publish some easy ones too. If i solve your "In's and Out's" next time(??!;-)) i will vote it 1kyu;-)! Germany is nice? Surely it has a good social system and some good conditions, so this and some other things are nice;-)... But the really friendly people live in Asia (i think), always smiling, friendly, and moderate often poor but rich inside... with exceptions as always, but nothing is perfect on earth;-)!

  • HerrWert Avatar

    I enjoyed this very much, but had to figure out the space problem for myself. It might be helpful to explain that the space that is both encountered in the input and required in the output might be different than the space produced by the keyboard.

    Otherwise, very enjoyable!

    • myjinxin2015 Avatar

      You should remove the spaces in the input string, only leave the Chinese characters. the output is an array, sometimes the array is not just all of the grid are used, the grid which unused need to fill two spaces to maintain the shape of whole.

      I don't know whether my answer is helpful, because in fact, I do not fully understand your English (please forgive my bad English) ;-)

    • HerrWert Avatar

      Your English is fine! I admire everyone on Codewars for how well they communicate in English, even when it's not their native language.

      Your answer is helpful. Now I understand better. What I thought was some kind of larger space character is actually two spaces. Fortunately my solution was still handling it successfully, despite my confusion. As you can see, my solution does remove the spaces from the input and then puts them back in the output when I "run out" of Chinese characters to insert. So everything's good :-)

    • 8fdafs2 Avatar

      Normally one Chinese character (Double-Byte Set) occupies twice the width of one ASCII character. So please hit your space-bar twice in this kata wherever it needs. Yes, I agree that this hint should be included in the description. @myjinxin2015 How do you think? ;)

    • myjinxin2015 Avatar

      I will add it soon.

    • HerrWert Avatar

      Thank you to both of you!

    • 8fdafs2 Avatar

      It's not that obvious for our native speakers to notice it. So thank you as well for pointing it out!

  • 8fdafs2 Avatar

    Glad to post the first user solution! I enjoy this Chinese Kata very much :) Thank you! IMHO, it might be better to center the first calligraphy image to align with its poem text; And you could just leave one example (plus a wikipedia link or something alike) instead of two to make the whole description less lengthy.

    • myjinxin2015 Avatar

      Because of the use of the markdown, did not notice that the picture is not in the middle, thank you for your feedback. Now that it has been corrected.

      According to your advice, I removed the longer poem and add two link of Chinese poetry and Chinese calligraphy. ;-)