[Tutor] Help with brute force algorithm

tempest.amogh tempest.amogh at gmail.com
Sun Jun 19 06:13:32 EDT 2022


As a personal project, I was inspired by Erik Demaine. He has created a font based on tetris shapes [http://erikdemaine.org/fonts/], however I would like to emulate this but based on another reference. I want to write an algorithm that brute force solves all the positions for these pieces in the english alphabet. I am having trouble making a grid that can be solved with these pieces, despite a book saying so.

I have attached the book that shows the shapes, and some pseudocode.

I would appreciate any possible guidance. Thank you very much :)

—
Regards,

Amogh Atwe

-------------- next part --------------
program start

import tetrominoes
import trominoes
import dominoes

input("Please write a word that you would like to see written").upper()

function(input):        
    for input{letter from alphabet}:
        
        backtracking algorithm, work from left to right:
            from filled letter to respective tetrominoes
            place(tetromino):
                for:
                    if tetromino does not fit in grid:
                        place in checked position:
                            place(tetromino)

                            repeat until pattern is found for letter, continue with rest of the letters
        
        print(letter from alphabet) in respective position with tetrominoes, trominoes and dominoes
        until no more letters


output (GUI of written word in combination of tetrominoes, trominoes, dominoes)


More information about the Tutor mailing list