i can't think of the logic of this machine problem..
the problem statement is this..
Using loop, write a program that will ask the user to enter a character for left or right. Then, the user will enter a number. The program should generate a ladder of x wherein the level depends on the number entered and the character should dictate whether it faces right or left.
Sample:
Character is r
Number is 3
Output
X
XX
XXX
Character is r
Number is 6
X
XX
XXX
XXXX
XXXXX
XXXXXX
character is l
number is 5
X
XX
XXX
XXXX
XXXXX <this one is facing left>
pls. help me..