cli345
Coder
Hello! 
FuncSug is a new programming language to facilitate web development (specially interactive site) by structuring one's code in the concurrent way.
For example, imagine you want to code a breakout game.
You would like to code something similar to:
In usual programming language, that is not easily possible: You have to structure your code differently.
In FuncSug, it's possible: see, my breakout example.
With this structure, some modifications of code are very easy.
For example, the number of balls for each "life" can be change just by adding a line in a 'parallel' block (cfr line 236 of breakoutPy.fg).
Here is the main part (simplified) of my breakout code:
Enjoy!
FuncSug is a new programming language to facilitate web development (specially interactive site) by structuring one's code in the concurrent way.
For example, imagine you want to code a breakout game.
You would like to code something similar to:
Code:
in_the_same_time:
run_the_ball()
run_the_paddle_according_to_the_mouse_move()
verify_and_manage_collision()
In FuncSug, it's possible: see, my breakout example.
With this structure, some modifications of code are very easy.
For example, the number of balls for each "life" can be change just by adding a line in a 'parallel' block (cfr line 236 of breakoutPy.fg).
Here is the main part (simplified) of my breakout code:
Code:
var column := |0, 1, 2, 3, 4|
var row := |0, 1, 2|
var numberOfLives := 3
parallel:
# Bricks
#--------
# usually, you don't have to specify 'sequence' because it's the default but, here, you have to (because this is in a 'parallel' block)
sequence:
# 'parallel forEachValueOf myVar' makes one parallel branch for each value of myVar
parallel forEachValueOf column:
parallel forEachValueOf row:
sequence:
# this executes all the life of the brick
lifeOfBrick(column, row)
# When the lives of all bricks end, you win
js ():
alert("YOU WIN, CONGRATS!")
document.location.reload()
# Ball(s)
#--------
sequence:
while numberOfLives > 0:
# When numberOfLives > 0, (a) new(s) ball(s) come(s) to life
parallel:
# comment/uncomment the following line if you want one/two ball(s) for each "life"
lifeOfBall()
lifeOfBall()
# When the life of the ball(s) end(s), numberOfLives decreases
numberOfLives -= 1
# When numberOfLives=0, you loose
js ():
alert("GAME OVER")
document.location.reload()
# Paddle
#--------
lifeOfPaddle()
Enjoy!