diff --git a/.github/workflows/basic.yaml b/.github/workflows/basic.yaml new file mode 100644 index 0000000..845f84c --- /dev/null +++ b/.github/workflows/basic.yaml @@ -0,0 +1,31 @@ +# This workflow will run stuff on the basic version of tictactoe + +name: Basic + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./tictactoe_basic + steps: + - uses: actions/checkout@v4 + - name: Install fbc + run: | + sudo apt-get install libtinfo5 + wget -O FreeBASIC-1.10.1-linux-x86_64.tar.gz 'http://downloads.sourceforge.net/fbc/FreeBASIC-1.10.1-linux-x86_64.tar.gz?download' + ls + tar xzf FreeBASIC-1.10.1-linux-x86_64.tar.gz + cd FreeBASIC-1.10.1-linux-x86_64 + sudo ./install.sh -i + fbc --version + - name: Compile + run: fbc tictactoe_basic.bas + - name: Run + run: ./tictactoe_basic diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 289e364..e954996 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -296,3 +296,6 @@ repos: # C# specific # None + + # basic specific + # None diff --git a/README.md b/README.md index 1135227..949a846 100644 --- a/README.md +++ b/README.md @@ -333,6 +333,16 @@ Run with: ./tictactoe_bash.sh ``` +## TicTacToe-Basic + +Version using [Basic](https://www.freebasic.net/). + +Compile and run with: +```bash +fbc tictactoe_basic.bas +./tictactoe_basic +``` + ## TicTacToe-scratch Very simple two player tictactoe game with Scratch. diff --git a/tictactoe_basic/tictactoe_basic.bas b/tictactoe_basic/tictactoe_basic.bas new file mode 100644 index 0000000..a525bfe --- /dev/null +++ b/tictactoe_basic/tictactoe_basic.bas @@ -0,0 +1,18 @@ +function AddNumbers( a as integer, b as integer ) as integer + return a + b +end function + +sub hello( ) + print "hello" +end sub + +declare sub myprint( num as integer ) + +'Code outside any procedures is the main part of the program +hello( ) +print AddNumbers( 1, 1 ) +myprint 5 + +sub myprint( num as integer ) + print num +end sub