by CodeChum Admin
I got my grandmother a new phone because I thought that we could talk more everyday by texting. Well, let’s just say that my grandma’s eyes aren’t the best anymore so she can’t really see what I text her and because of that she wants to ditch texting and stick with carrier pigeons. You know how embarrassing it is for a kid like me to be seen using carrier pigeons?!?! Well, anyway, I was hoping that you could make a program that takes my text and make it bigger, a LOT bigger. How about you test it out by only using the letters A, B, and C first.
Input
1. My text
Description
This is a string with characters A, B, and C.
Constraints
It is guaranteed that all letters are in uppercase.
Output
The first line will contain a message prompt to input my text.
The succeeding lines will contain the enlarged text.
Enter·my·text:·ABC
***·**··***
*·*·*·*·*
***·**··*
*·*·*·*·*
*·*·**··***
import pygame
from pygame.locals import *
pygame.init()
pygame.font.init()
def createFont(t,s=83,c=(255,255,0), b=False,i=False):
font = pygame.font.SysFont("Times New Roman", s, bold=b, italic=i)
mytext = font.render(t, True, c)
return mytext
str1 = input("Input your text: ")
game_over = createFont(str1)
sf = pygame.display.set_mode((500, 300))
loop = True
clock = pygame.time.Clock()
while loop == True:
sf.fill((0,0,0))
x, y = pygame.mouse.get_pos()
sf.blit(game_over, (100,150))
for e in pygame.event.get():
if e.type == QUIT:
loop = 0
pygame.display.update()
clock.tick(60)
pygame.quit()
Comments
Leave a comment