0
Is there any alternative way for making these patterns. All the different answers and suggestions are most welcomed.
https://www.sololearn.com/compiler-playground/cs01zha15r96/#cpp
2 Réponses
+ 2
Obviously u use a 5*5 Matrix. So why not use as base?
(1 could be a bug?)
As you see, some lines are repeated.
If you dont insist on your design, the 7-Segmant-Display reduces numbers to 7 segments.
That could be a HashMap, Dictionary... whatever you want.
If u insist on your design: Try a 5*5 matrix and use some functions for some special lines.
*****
*
*****
*
*****
Look here: you have 3 horizontal lines and all of them are used in other numbers too.
I would make a function from each of them or a function horizontal with veritcal position (1,2,3) as parameter.
Same counts for vertical lines.
0
Answers in languages like java, Python, C, JS are also welcomed.
Please give solutions, it will help me to understand the concepts clearly.