Back
Close

CodinDrink

Statement

 Goal

You decided to open a coffee house and already found a lovely place for it. To advertise it, you serve everybody for free on the first day. However, you underestimated the number of customers and can't do everything by yourself. Teach a bot to make drinks for you.

Your script should draw a cup of an ordered drink. A customer can choose the drink and whether to add a straw to it. The type of drink is typed in the center of a cup. straw is placed in the middle top. All the cups are of the same size (9 symbols width, 4 symbols height). The top and the bottom are formed with underscores ('_').
Input
Line 1: A string drink with a drink name.
Line 1: An integer straw. 1 if a straw should be added, 0 if not.
Output
Four lines representing a cup with the selected drink.
Constraints
drink is always a single symbol.
Example
Input
L
1
Output
____|____
\       /
 \  L  /
  \___/

Game modes
ShortestReverse

Test cases
Latte Test
Input
L 1
Output
____|____ \ / \ L / \___/

Coffee Validator
Input
C 1
Output
____|____ \ / \ C / \___/

No straw Test
Input
C 0
Output
_________ \ / \ C / \___/

No straw Validator
Input
M 0
Output
_________ \ / \ M / \___/

Test 3 Test
Input
@ 0
Output
_________ \ / \ @ / \___/

Validator 3 Validator
Input
# 0
Output
_________ \ / \ # / \___/

Test 4 Test
Input
\ 1
Output
____|____ \ / \ \ / \___/

Validator 4 Validator
Input
\ 0
Output
_________ \ / \ \ / \___/

Solution language

Solution

Stub generator input
codingame x discord
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
JOIN US ON DISCORD
Online Participants