Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tentaclepurple/42_ft_turing
Implementation of the famous mathematician computational model in Scala
https://github.com/tentaclepurple/42_ft_turing
algorithms computer-science mathematics scala
Last synced: 1 day ago
JSON representation
Implementation of the famous mathematician computational model in Scala
- Host: GitHub
- URL: https://github.com/tentaclepurple/42_ft_turing
- Owner: tentaclepurple
- Created: 2024-11-22T18:21:50.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2025-01-26T01:25:36.000Z (2 days ago)
- Last Synced: 2025-01-26T02:34:06.363Z (2 days ago)
- Topics: algorithms, computer-science, mathematics, scala
- Language: Scala
- Homepage:
- Size: 9.28 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ft_turing š¤
A functional implementation of a Turing Machine simulator in Scala, including a Universal Turing Machine (UTM)!
## š Try it Online!
**[Live Demo: Turing Machine Simulator](https://turingmachine.streamlit.app/)** *(Ctrl+click to open in new tab)*
## Overview
This project implements a single-headed, single-tape Turing machine capable of:
- Processing machine descriptions from JSON files
- Simulating standard Turing machines
- Operating as a Universal Turing Machine
- Computing time complexity (bonus feature)## Features
### Core Functionality
- šÆ Single-headed, single-tape Turing machine implementation
- š JSON-based machine configuration
- š Step-by-step visualization of the machine's execution
- ā” Adjustable execution speed (up to 10x)
- š Error detection and handling for invalid inputs or configurations### Included Machines
1. **Unary Addition**: Computes the sum of two unary numbers
2. **Palindrome Checker**: Determines if input is a palindrome
3. **0āæ1āæ Language**: Validates if input matches format 0āæ1āæ
4. **02āæ Language**: Validates if input matches format 02āæ
5. **Universal Turing Machine**: Simulates the unary addition machine### Bonus Feature
- Time complexity analysis for executed algorithms
- Visual representation of computational steps
- Complexity classification (O(1), O(n), O(n log n), O(nĀ²), O(nĀ³))## Web Interface
The web interface (built with Streamlit) provides:
- Interactive machine selection
- Real-time tape visualization
- Speed control
- Dark mode UI
- Responsive design## Technical Details
### Built With
- Scala 3
- Functional programming principles
- Streamlit (web interface)
- Play JSON for configuration parsing### Architecture
- Pure functional implementation
- Immutable data structures
- Pattern matching for state transitions
- Type-safe representation of machine configurations## Getting Started
### Prerequisites
- Scala 3.x
- sbt# Run with SBT
sbt run "machines/unary_add.json" "1+1="## Contact
For any questions or feedback about the project, feel free to reach out!
## Acknowledgments
- Alan Turing, for his groundbreaking work in computer science
- 42 School, for the challenging project subject
- The Scala community for excellent tooling and documentation---
Happy computing! š§®āØ