Skip to content
Open

Hi #1

Show file tree
Hide file tree
Changes from all 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
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
# wordScript: easy programming langauge ( without semicolon's )
This Project is to help people that don't know how to code or have trouble understanding code to make coding easiler by using keywords to start code.
<br>
We built this project by using HTML,CSS and javascript.
The challenges we ran into is how to get the display to look like real programming sites with the numbers and in the javascript we had some problems with names and code, it was everywhere so it was hard to reorganized it
We learned a lot with a text editor libary called ACE and we learned how to create keywords in the program and transform the keywords into javascript
We learned a lot with a text editor libary called ACE and we learned how to create keywords in the program and transform the keywords into javascript.
<br>
What's next with this project is to incorporate more software languages with text editors and add in a better system so people are able to understand how code work more easily


# features:
# language:
```
# Start your work here
//Start your work here
# this a comment in wordScript

make var x : 3
make var x:3

make function addTwo [x] return x + 2]

make function addTwo [x] return x + 2
call addTwo with args 3
# call addTwo with args 3

print 'hi'

make loop 1 to 5

```
25 changes: 23 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

var editor = ace.edit("editor"); // the numbering
editor.setTheme("ace/theme/monokai"); // theme
editor.getSession().setMode("ace/mode/javascript"); // language want to use
Expand Down Expand Up @@ -121,7 +120,8 @@ function makeFunction( input ) {
}
else if ( body[0] === 'print' ) {

body = print( body.splice(1, body.length) );

body = print( body );
}
else {

Expand All @@ -136,6 +136,23 @@ function makeFunction( input ) {

}


function makeCondition( condition, input ) {

input = input.split(' ').slice(1, input.length);

if ( condition === 'if' ) {

console.log( input );
}
if ( condition === 'else' ) {

console.log( input );
}

// console.log( input );
}

function callFunction( input ) {

for(var i = 0; i < data.func.length; i++) {
Expand Down Expand Up @@ -283,6 +300,10 @@ function parseInput( input ) {
break;
}
break;
case 'if':

output = makeCondition('if', input);
break;
case 'print':

output = print( input );
Expand Down
11 changes: 11 additions & 0 deletions wordScript-cli/app.ws
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
make var x : "hello, world"

# print x

# make loop 1 to 10

# make function addTwo [y] return y + 2

# print call addTwo with args x.length

print x.length + 2
25 changes: 25 additions & 0 deletions wordScript-cli/cli.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
const clib = require('./clib'),
wordScript = require('./compiler.js');

function method(action, obj) {

switch ( action ) {

case 'run':

console.log('compiling....');

const file_name = obj.payload[0];

wordScript.compile( file_name );
break;
}
}


clib.argParser(process.argv, (err, obj) => {
if (err) return clib.catchError(err);


clib.dispatch_action(method, obj);
});
1 change: 1 addition & 0 deletions wordScript-cli/clib
Submodule clib added at ca23f2
Loading