-
TS 5.3 At CheckiO! Try It While Solving Missions About Diamonds, Dices And Lunar Myltiply!
Hello CheckiO users! 🙂
🚀Exciting news! We've just launched our brand-new Instagram page! 🎉 Follow us @playcheckio for exclusive updates, join the journey and be part of our community! 🌟
The CheckiO Team continues to work on improving the site and now we implement at CheckiO the latest version of TypeScript - 5.3! Hope, you will use all its features at your solutions.
Three new missions are placed from Polygon to other stations. These missions are about forming letters in diamond shape, rolling the dice and finding out its final position and making "lunar" multiplication. Sounds interesting?! Let's try it with our latest TypeScript.
The Hollow Diamond by freeman_lex - Your function should return a multiline string of unique lowercase letters in alphabetical order. The characters should be placed in a form of hollow rhombus (diamond), along its edges, starting from the top vertex.
For this purpose you are given three values (for their constraints see Preconditions):
- side - number of letters in each side of the rhombus;
- length - total number of letters you should use;
- cw - clockwise flag, which shows in what direction the letters must go (if true - letters should be placed in clockwise direction).
If it's not enough length to complete the form, complement it with "*". The rhombus should not have white spaces at the right.
assert.strictEqual(hollowDiamond(3, 8, true), " a\n h b\ng c\n f d\n e"); assert.strictEqual(hollowDiamond(3, 6, false), " a\n b *\nc *\n d f\n e");
Rolling 🎲! by freeman_lex - There is a standard 6-sided 🎲, which looks and placed as shown below. It may be rolled in four cardinal directions: North, South, West, East.
For the mission you are given a string moves with directions. You need to find out, what side of 🎲 is on top after rolling.
assert.strictEqual(rollingDice("SN"), 1); assert.strictEqual(rollingDice(""), 1); assert.strictEqual(rollingDice("EESWN"), 6); assert.strictEqual(rollingDice("NWSNWEESNW"), 3);
"Lunar" Multiply by freeman_lex - Formerly known as “dismal arithmetic”, addition and multiplication of natural numbers are redefined so that adding two digits means taking their maximum, whereas multiplying two digits means taking their minimum. For example, 2 + 7 = 7 + 2 = 7 and 2 × 7 = 7 × 2 = 2. Unlike ordinary addition, there can never be a carry to the next column of digits, no matter how many individual digits are added together in that column. For numbers that consist of several digits, addition and multiplication work exactly as you learned back in grade school, except that the shifted digit columns from lunar multiplication of the individual digits are added in the same lunatic fashion.
assert.strictEqual(lunarMultiply(2, 3), 2); assert.strictEqual(lunarMultiply(8, 9), 8); assert.strictEqual(lunarMultiply(10, 10), 100); assert.strictEqual(lunarMultiply(11, 11), 111);
💡 For your attention 3 articles from the TypeScript world. They are about new features at TS 5.3 and 5.4 (beta) and new Set functions.
What's New in TypeScript 5.3 - Microsoft advanced TypeScript to version 5.3 with a bevy of changes affecting everything from import attributes to interactive inlay hints for types, along with multiple optimizations.
Union, intersection, difference, and more are coming to JavaScript Sets - The JavaScript Set was introduced to the language in the ES2015 spec, but it has always seemed incomplete. That's about to change.
Announcing TypeScript 5.4 Beta - Let's see, what’s new in TypeScript 5.4!
What methods of code debugging do you use?!
🙌 Thanks for your attention! Hope to meet you at CheckiO. We are really interested in your thoughts! Please, leave a comment below! ⤵
Welcome to CheckiO - games for coders where you can improve your codings skills.
The main idea behind these games is to give you the opportunity to learn by exchanging experience with the rest of the community. Every day we are trying to find interesting solutions for you to help you become a better coder.
Join the Game