Skip to content

Sudoku solver written in python that interfaces with Unreal Engine for the GUI

Notifications You must be signed in to change notification settings

RyanAWalters/UnrealPythonSudokuSolver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unreal Python Sudoku Solver

Unreal Engine <-> Python Interface

Sudoku solver written in Python that interfaces with Unreal Engine for the GUI.

In this team project, we created a Python script to generate and solve sudoku puzzles. It does this by using constrained back-propogation algorithms. But we needed a user interface. I used Unreal Engine and created a sudoku puzzle class and made a simple script that solved the puzzle with a brute force algorithm (significantly slower that the Python script, for effect). Instead of translating the Python code to C++, I used Rama's plugin that allows for OS process creation and created an interface between Unreal Engine and Python. This is the call to Python that is run in a new process:

"from sudoku1 import *; v = generate( [variable_from_unreal_engine] ); tofile('input.txt', v); solve([v])"

The semicolons actually execute the command up until that point (which I certainly didn't know about the command line and Python).

While this is really cool in my opinion, the applications are probably limited. It's slow and relies on the transfer of strings between Unreal Engine and Python. However it handles this small proof of concept example very well.

The part of the Unreal Engine script that interfaces with the Python script:

The brute force method of solving the puzzle:

The back propogation method of solving the puzzle using the Python script:

About

Sudoku solver written in python that interfaces with Unreal Engine for the GUI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages