I'm making a program which takes a file with an ASCII art alphabet and uses it to print words. It takes 3 lines of input The width, The Height and The desired word. My problem is that I can make the characters print on the same line, they print one after the other like so:
Height: 8
Width: 9
Text: TOP
_________
\__ __/
) (
| |
| |
| |
| |
)_(
_______
( ___ )
| ( ) |
| | | |
| | | |
| | | |
| (___) |
(_______)
_______
( ____ )
| ( )|
| (____)|
| _____)
| (
| )
|/
This is my code:
temp = []
hi = input('Height: ')
wi = input('Width: ')
tx = input('Text: ')
fi = open("font.txt")
for i in tx:
temp = cd[i]
var1 = int(temp[0])
ra1 = (var1 * int(hi))
ra1n = (ra1 + int(hi))
temp = []
fi = open("font.txt")
lines = fi.readlines()
print(''.join(lines[ra1:ra1n]),end='')
font.txt looks like this
_______
( ___ )
| ( ) |
| (___) |
| ___ |
| ( ) |
| ) ( |
|/ \|
______
( ___ \
| ( ) )
| (__/ /
| __ (
| ( \ \
| )___) )
|/ \___/
_______
( ____ \
| ( \/
| |
| |
| |
| (____/\
(_______/
______
( __ \
| ( \ )
| | ) |
| | | |
| | ) |
| (__/ )
(______/
_______
( ____ \
| ( \/
| (__
| __)
| (
| (____/\
(_______/
_______
( ____ \
| ( \/
| (__
| __)
| (
| )
|/
_______
( ____ \
| ( \/
| |
| | ____
| | \_ )
| (___) |
(_______)
|\ /|
| ) ( |
| (___) |
| ___ |
| ( ) |
| ) ( |
|/ \|
_________
\__ __/
) (
| |
| |
| |
___) (___
\_______/
_________
\__ _/
) (
| |
| |
| |
|\_) )
(____/
_
| \ /\
| \ / /
| (_/ /
| _ (
| ( \ \
| / \ \
|_/ \/
_
( \
| (
| |
| |
| |
| (____/\
(_______/
_______
( )
| () () |
| || || |
| |(_)| |
| | | |
| ) ( |
|/ \|
_
( ( /|
| \ ( |
| \ | |
| (\ \) |
| | \ |
| ) \ |
|/ )_)
_______
( ___ )
| ( ) |
| | | |
| | | |
| | | |
| (___) |
(_______)
_______
( ____ )
| ( )|
| (____)|
| _____)
| (
| )
|/
_______
( ___ )
| ( ) |
| | | |
| | | |
| | /\| |
| (_\ \ |
(____\/_)
_______
( ____ )
| ( )|
| (____)|
| __)
| (\ (
| ) \ \__
|/ \__/
_______
( ____ \
| ( \/
| (_____
(_____ )
) |
/\____) |
\_______)
_________
\__ __/
) (
| |
| |
| |
| |
)_(
|\ /|
| ) ( |
| | | |
| | | |
| | | |
| (___) |
(_______)
|\ /|
| ) ( |
| | | |
( ( ) )
\ \_/ /
\ /
\_/
|\ /|
| ) ( |
| | _ | |
| |( )| |
| || || |
| () () |
(_______)
|\ /|
( \ / )
\ (_) /
) _ (
/ ( ) \
( / \ )
|/ \|
|\ /|
( \ / )
\ (_) /
\ /
) (
| |
\_/
_______
/ ___ )
\/ ) |
/ )
/ /
/ /
/ (_/\
(_______/