Fandom

Petit Computer Wiki

SimpleC Interpreter

914pages on
this wiki
Add New Page
Comments49 Share
SimpleC Interpreter
Simplec code

General Info
Contributor(s): IAmAPersson
Release Date: September 28, 2013
Development Status: Final
Version: 1.2
Size: Unknown
Mode(s): Edit, Run
Language(s): English


I got bored one day and decided to make a simple interpreter of a language called SimpleC. It is HEAVILY influenced by C++, so if you know the language, this shouldn't be hard at all to learn. This interpreter includes:

Max of 999 lines

Up to 250+ strings and 250+ variables

Input/output

IF...THEN...ELSE like statement (WHEN...DO...ELSE)

Math

Basic/essential commands

Basic graphics

Objects (sprites)

Instructions

Enter a line, and press A. Move the dot you see to the next line you want to edit and press A again. To run, instead of selecting a line with the dot, press B. To save your program, press X. To load a program, press Y. List of commands and their syntax listed below.

Changelog

Version 1.2

  • Added ability to have up to 999 lines, 250+ strings, 250+ variables, saving and loading programs, ELSE command, fixed glitches with the WHEN command, finished development.

Version 1.1

  • Renamed to SimpleC, major changes to syntax of almost every command, GOTO, added object support.

Version 1.0

  • Basic essential commands, edit mode, run mode

Download

SIMPLEC







Command List

Download the .rtf file containing a tutorial of the entire language at http://www.2shared.com/document/6WhyCHsw/SimpleC_Manual.html

Notes

This program's development is finished. If you have anything else you'd like me to add, tell me and I'll consider it. Feel free to post your programs in the comments section! I'd love to see what you guys are making!

Example Programs

Here's a few sample programs I made to help you guys out.

Hello world:

 OUT<"Hello, world!"
 SLP[BUT[16]]
 STOP

Demonstrating input/output:

 START:
 OUT<"Hello!\n"
 OUT<"How are you? (GOOD/BAD)\n"
 IN> STR[A]
 SETV STR[G]=GOOD
 SETV STR[B]=BAD
 WHEN STR[A]=G DO{
 OUT<"Awesome!"
 GOTO END
 ELSE{
 WHEN STR[A]=B DO{
 OUT<"Awww. Hope you feel better."
 GOTO END
 }
 }}
 OUT<"Oops! I don't know what "
 OUT<STR[A]
 OUT<" means!\n"
 GOTO START
 END:
 SLP[BUT[32]]
 STOP

Demonstrating graphics:

 OUT<"Here's a circle!"
 DRAW.CRCL[127;95,20] 67
 SLP[BUT[16]]

Allows you to move an object around the screen:

 OBJCT.SET[1,0;0,0]
 SETV VAR[1]=1
 LOOP:
 WHEN BUT[]=1 DO{
 MATH Y=Y-1
 } 
 WHEN BUT[]=2 DO{
 MATH Y=Y+1
 }
 WHEN BUT[]=4 DO{
 MATH X=X-1
 }
 WHEN BUT[]=8 DO{
 MATH X=X+1
 }
 OBJCT.MOV[1,X;Y]
 WHEN BUT[]=16 DO{
 STOP
 ELSE{
 GOTO LOOP
 }}

This demonstrates the speed of the language:

 VCLR
 SETV VAR[1]=1
 LOOP:
 MATH L=L+1
 OUT<VAR[1]
 OUT<"\n"
 GOTO LOOP

These are source code examples. Here's some slightly different but scannable programs!

HELLOW
CALCULAT
INPTTEST
OBJECT M

























Credits

IAmAPerson620 - Everything

License

The Free-Use License

Copyright (c) 2013 Persson Creations

In downloading this program, permission is given to ANY and ALL users to use and edit this software. However, this software may NOT be redistributed to ANYONE without permission from IAmAPersson, even if unedited. If this is ignored, the redistributed program will be reported and deleted ASAP.

This software comes AS IS. It comes with NO warranty whatsoever. If the program does not work as expected, the user MAY report the problem to IAmAPersson, but NO certainty is given that it will be fixed. IAmAPersson is NOT responsible for ANY damages, including but not limited to the user's device and/or the software due to misuse.

The software name "SimpleC Interpreter" belongs completely to IAmAPersson, and may NOT be used as a name for ANY other program.

If this software is redistributed rightly according to the regulations of this license, the redistributor is REQUIRED to include this license with his/her copy of "SimpleC Interpreter," along with a link to the original program. The user is also required to give a disclaimer, stating that he/she is NOT the original creator of the software, and give credit appropriately.

By downloading "SimpleC Interpreter," any and all users agree to follow ALL points stated in this license, and to use this program rightly in all ways, shapes, AND forms.

Where You Can Find Me

I can be found on the NintendoLife Petit Computer Forums .

If you have a question about programming and you with for an answer not-on-forum, use my Message Wall!

I am also on the Special Chat a lot!

I do not give out my email, so do not even ask.

3DS Friend Code: 2148-9259-0831

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.