Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
Build:
strategy:
matrix:
app_name: [Calculator, Diceware, GPIO, GraphicsDemo, HelloWorld, SerialConsole, TwoEleven, TamaTac, MystifyDemo, Snake]
app_name: [Brainfuck, Breakout, Calculator, Diceware, GPIO, GraphicsDemo, HelloWorld, Magic8Ball, MystifyDemo, SerialConsole, Snake, TamaTac, TodoList, TwoEleven]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
16 changes: 16 additions & 0 deletions Apps/Brainfuck/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
cmake_minimum_required(VERSION 3.20)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)

if (DEFINED ENV{TACTILITY_SDK_PATH})
set(TACTILITY_SDK_PATH $ENV{TACTILITY_SDK_PATH})
else()
set(TACTILITY_SDK_PATH "../../release/TactilitySDK")
message(WARNING "TACTILITY_SDK_PATH environment variable is not set, defaulting to ${TACTILITY_SDK_PATH}")
endif()

include("${TACTILITY_SDK_PATH}/TactilitySDK.cmake")
set(EXTRA_COMPONENT_DIRS ${TACTILITY_SDK_PATH})

project(Brainfuck)
tactility_project(Brainfuck)
46 changes: 46 additions & 0 deletions Apps/Brainfuck/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Brainfuck

A Brainfuck esoteric programming language interpreter for Tactility.

## Overview

Run Brainfuck programs on your device. Includes built-in examples and support for loading scripts from the SD card. Features cycle limit protection to prevent infinite loops from locking up the device.

## Features

- Full Brainfuck VM with 4096-byte tape
- Cycle limit protection (2,000,000 cycles max)
- Built-in examples (Hello World, Fibonacci, Alphabet, Beer song)
- Multi-line code editor
- Execution statistics (cycle count display)
- Load scripts from SD card

## Controls

- **Run Button**: Execute Brainfuck code
- **Enter Key**: Run code from input area
- **Toolbar Buttons**:
- Trash icon: Clear output and input
- List icon: Toggle between examples/scripts list and editor

## SD Card Support

Place `.bf` or `.b` files (up to 32 KB each) in `/sdcard/tactility/brainfuck/` to load them from the app.

## Brainfuck Reference

| Command | Description |
|---------|-------------|
| `>` | Move pointer right |
| `<` | Move pointer left |
| `+` | Increment byte at pointer |
| `-` | Decrement byte at pointer |
| `.` | Output byte as ASCII |
| `,` | Input byte (not supported) |
| `[` | Jump forward past `]` if byte is zero |
| `]` | Jump back to `[` if byte is nonzero |

## Requirements

- Tactility
- Touchscreen or keyboard
11 changes: 11 additions & 0 deletions Apps/Brainfuck/main/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
file(GLOB_RECURSE SOURCE_FILES
Source/*.c*
)

idf_component_register(
SRCS ${SOURCE_FILES}
# Library headers must be included directly,
# because all regular dependencies get stripped by elf_loader's cmake script
INCLUDE_DIRS ../../../Libraries/TactilityCpp/Include
REQUIRES TactilitySDK
)
Loading