Coder Social home page Coder Social logo

sergio0694 / brainf_cksharp Goto Github PK

View Code? Open in Web Editor NEW
53.0 3.0 6.0 7.33 MB

A complete and full-featured Brainf_ck IDE/console for Windows 10 (UWP), with a high-performance REPL interpreter

Home Page: https://www.microsoft.com/store/apps/9nblgggzhvq5?cid=github

License: GNU General Public License v3.0

C# 99.96% PowerShell 0.04%
brainfuck brainfuck-interpreter esoteric-language esoteric-programming-language esoteric-interpreter library netstandard csharp

brainf_cksharp's Introduction

Brainf*ck#

A complete, full-featured Brainf*ck IDE/console for Windows 10, built from the ground up as a UWP app.

Get it from Microsoft

Overview

image

  • IDE with syntax highlight and code autocompletion
  • Indentation depth indicators and column guides
  • Git diff markers to see the changes in the current code file
  • Breakpoints support with complete debugging experience
  • Full featured console to test your scripts and improve your coding level
  • Real time memory state with the all the info about every cell and the pointer actual position
  • Exceptions handler, infinite loops auto suppression
  • Complete 8 bit Unicode char lookup table to see the values of the characters in the Stdin buffer
  • Touch friendly UI with on screen custom keyboard and dedicated text navigation buttons
  • Undo/redo features to help you write your code more easily
  • An interpreter debugger that shows the position of the operator that caused the exception and the stack trace
  • Save your scripts in your personal library shared across devices and edit them whenever you want
  • Custom overflow mode for the memory state
  • PBrain extensions support to declare and call functions

Required dependencies ๐Ÿ”ง

The Brainf*ck# solution requires the following tools to build all the available projects:

Contributing ๐Ÿ™Œ

Brainf*ck# is open source and free to download in the Store, with just an optional IAP to unlock additional themes for the IDE. If you found a bug, feel free to open an issue or draft a PR! If you'd like to support me instead, you can:

  • Give a star to the repository
  • Download the app and leave a review in the Store
  • Make a small contribution on my PayPal.me link ๐Ÿป

Dependencies and references ๐Ÿ”–

Trivia ๐Ÿ“–

This project was the one I used to prototype and develop both the CommunityToolkit.Mvvm and CommunityToolkit.HighPerformance packages, which are heavily used in the projects in this repository.

If you'd like to learn more on these libraries:

  • See our samples and docs on the MVVM Toolkit at aka.ms/mvvmtoolkit
  • See the docs on the HighPerformance package here
  • Explore the codebase for these and other Windows Community Toolkit packages here

brainf_cksharp's People

Contributors

sergio0694 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

brainf_cksharp's Issues

Hello World! program with comments fails

Description (optional)

This section should contain an expanded description
of the bug, if the title is not sufficient.

Reproduction Steps

Run this code

[ This program prints "Hello World!" and a newline to the screen, its
  length is 106 active command characters. [It is not the shortest.]

  This loop is an "initial comment loop", a simple way of adding a comment
  to a BF program such that you don't have to worry about any command
  characters. Any ".", ",", "+", "-", "<" and ">" characters are simply
  ignored, the "[" and "]" characters just have to be balanced. This
  loop and the commands it contains are ignored because the current cell
  defaults to a value of 0; the 0 value causes this loop to be skipped.
]
++++++++               Set Cell #0 to 8
[
    >++++               Add 4 to Cell #1; this will always set Cell #1 to 4
    [                   as the cell will be cleared by the loop
        >++             Add 2 to Cell #2
        >+++            Add 3 to Cell #3
        >+++            Add 3 to Cell #4
        >+              Add 1 to Cell #5
        <<<<-           Decrement the loop counter in Cell #1
    ]                   Loop until Cell #1 is zero; number of iterations is 4
    >+                  Add 1 to Cell #2
    >+                  Add 1 to Cell #3
    >-                  Subtract 1 from Cell #4
    >>+                 Add 1 to Cell #6
    [<]                 Move back to the first zero cell you find; this will
                        be Cell #1 which was cleared by the previous loop
    <-                  Decrement the loop Counter in Cell #0
]                       Loop until Cell #0 is zero; number of iterations is 8

The result of this is:
Cell no :   0   1   2   3   4   5   6
Contents:   0   0  72 104  88  32   8
Pointer :   ^

>>.                     Cell #2 has value 72 which is 'H'
>---.                   Subtract 3 from Cell #3 to get 101 which is 'e'
+++++++..+++.           Likewise for 'llo' from Cell #3
>>.                     Cell #5 is 32 for the space
<-.                     Subtract 1 from Cell #4 for 87 to give a 'W'
<.                      Cell #3 was set to 'o' from the end of 'Hello'
+++.------.--------.    Cell #3 for 'rl' and 'd'
>>+.                    Add 1 to Cell #5 gives us an exclamation point
>++.                    And finally a newline from Cell #6

Expected Behavior

Prints hello world

Actual Behavior

[RUNTIME ERROR] Undefined function call

System info

  • Ran from HEAD
  • macOS
  • .NET 8

Repro steps for .NET Native startup crashes

Hey @alwu-msft, thank you for the help!

As I mentioned in my VS issue, I had two crashes related with .NET Native.
The related GitHub issue is this one: microsoft/microsoft-ui-xaml#2545.

Now, the crash in Release is actually vanished somehow and I can't reproduce it anymore not even by checking out to a past commit. The only thing I can think of is that I've updated my PC from 19041.264 to 19041.329, not sure how that might be related though.

I also tried checking out to one of the repro branches I had made for @LanceMcCarthy and I can't repro the Release crash there anymore either, so it does seem to be related to maybe the latest Windows 10 update, or some other thing external to my code and NuGet packages in use ๐Ÿค”

That said, I can still reproduce the crash in Debug with .NET Native though:

  • Clone the repo and switch to repro/sdk-cras-release (the issue appears on master too, this branch is just easier to test though as I've removed a lot of non UI-specific code and projects)
  • Open the solution
  • Right click on Brainf_ckSharp.Uwp > properties > Build
  • Select the Debug x64 config and tick "Enable .NET Native toolchain"
  • Set that project as startup project
  • Run the project

I'm getting a startup crash when doing so, see screen here:

image

Let me know if there's anything I can do to help on my end too, and thanks again! ๐Ÿ˜„

Double Check Microsoft.UI.Xaml Replaces Windows.UI.Xaml

When right-clicking on the Textbox, the application crashes. The following output is available in the Windows Event Viewer

Event Viewer

Faulting application name: Brainf_ckSharp.Uwp.exe, version: 1.0.0.0, time stamp: 0x5ee155af
Faulting module name: Windows.UI.Xaml.dll, version: 10.0.18362.815, time stamp: 0x9fa806f2
Exception code: 0xc000027b
Fault offset: 0x0000000000713530
Faulting process id: 0x61ec
Faulting application start time: 0x01d63f71d635f57a
Faulting application path: C:\Program Files\WindowsApps\77cee5e8-8481-4e69-92bc-31cfb2a6bc2b_1.610.1.0_x64__4tcmghg6akv1r\Brainf_ckSharp.Uwp.exe
Faulting module path: C:\Windows\System32\Windows.UI.Xaml.dll
Report Id: 22e98e81-c491-492c-9b5c-e0806edd6751
Faulting package full name: 77cee5e8-8481-4e69-92bc-31cfb2a6bc2b_1.610.1.0_x64__4tcmghg6akv1r
Faulting package-relative application ID: App

Sergio has shared a screenshot (from DevCenter?) that further implicates the issue is in Windows.UI.Xaml in the crash

image

I'm surprised that Windows.UI.Xaml is being used instead of Microsoft.UI.Xaml, but I'm not well versed in how the WinUI sets the types under the covers. This could well be the expected output for a crash on a WinUI ContentPresenter.

Possible duplicated file

Is this just a leftover file after a casing change or desired?

warning: the following paths have collided (e.g. case-sensitive paths
on a case-insensitive filesystem) and only one from the same
colliding group is in the working tree:

  'src/Brainf_ckSharp.Uwp.Controls.Ide/Properties/Brainf_ckSharp.UWP.Controls.IDE.rd.xml'
  'src/Brainf_ckSharp.Uwp.Controls.Ide/Properties/Brainf_ckSharp.Uwp.Controls.Ide.rd.xml'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.