Skip to content

Hello World

cl4cnam edited this page Nov 18, 2023 · 5 revisions

Here, you'll learn how to make a simple "Hello, World!" program.

Prepare your environment

  1. Make a new folder for your program and name it, say helloWorldProgram.

  2. Make a new file in it and name it helloWorld.html.

  3. Copy and paste these lines into it:

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>Hello World</title>
		<link rel="shortcut icon" href="#">
		<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/cl4cnam/funcSug@b3f8fb8eafcc4dac5a72d87018c743db42437226/lib.css">
	</head>

	<body>
		<script src="https://cdn.jsdelivr.net/gh/cl4cnam/funcSug@b3f8fb8eafcc4dac5a72d87018c743db42437226/libStd.fg" type="application/funcsug"></script>
		<script src="https://cdn.jsdelivr.net/gh/cl4cnam/funcSug@b3f8fb8eafcc4dac5a72d87018c743db42437226/libDOM.fg" type="application/funcsug"></script>
		<script src="helloWorld.fg" type="application/funcsug"></script>
		<script src="https://cdn.jsdelivr.net/gh/cl4cnam/funcSug@b3f8fb8eafcc4dac5a72d87018c743db42437226/parser.js"></script>
		<script src="https://cdn.jsdelivr.net/gh/cl4cnam/funcSug@b3f8fb8eafcc4dac5a72d87018c743db42437226/parserPy.js"></script>
		<script src="https://cdn.jsdelivr.net/gh/cl4cnam/funcSug@b3f8fb8eafcc4dac5a72d87018c743db42437226/interpreter.js"></script>
		<script src="https://cdn.jsdelivr.net/gh/cl4cnam/funcSug@b3f8fb8eafcc4dac5a72d87018c743db42437226/DOMloader.js"></script>
	</body>
</html>

You'll write your program into helloWorld.fg

Note

You'll have to include at least all the lines in the body (except the one with helloWorld.fg) into all your FuncSug programs, that is:

<script src="https://cdn.jsdelivr.net/gh/cl4cnam/funcSug@b3f8fb8eafcc4dac5a72d87018c743db42437226/libStd.fg" type="application/funcsug"></script>
<script src="https://cdn.jsdelivr.net/gh/cl4cnam/funcSug@b3f8fb8eafcc4dac5a72d87018c743db42437226/libDOM.fg" type="application/funcsug"></script>
<script src="https://cdn.jsdelivr.net/gh/cl4cnam/funcSug@b3f8fb8eafcc4dac5a72d87018c743db42437226/parser.js"></script>
<script src="https://cdn.jsdelivr.net/gh/cl4cnam/funcSug@b3f8fb8eafcc4dac5a72d87018c743db42437226/parserPy.js"></script>
<script src="https://cdn.jsdelivr.net/gh/cl4cnam/funcSug@b3f8fb8eafcc4dac5a72d87018c743db42437226/interpreter.js"></script>
<script src="https://cdn.jsdelivr.net/gh/cl4cnam/funcSug@b3f8fb8eafcc4dac5a72d87018c743db42437226/DOMloader.js"></script>
  1. Make a new file in the helloWorldProgram folder and name it helloWorld.fg.

Write the program

Write this line into helloWorld.fg:

displayNewMessage('Hello, World!')

Test the program

  1. Run the server

On Windows, open a "command line" and type this:

cd hereTypeThePathTohelloWorldProgramDirectory
py -m http.server 8000 --bind 127.0.0.1

On Linux, type this:

cd hereTypeThePathTohelloWorldProgramDirectory
python3 -m http.server 8000 --bind 127.0.0.1
  1. Run the page

Open a browser this url into a browser: http://127.0.0.1:8000/helloWorld.html

You should get something like this:

helloWorld

Note

Don't worry! You'll be able to change the style of the message.

⏭️ Next tutorial

Clone this wiki locally