mirror of
https://github.com/sam-astro/Z-Sharp.git
synced 2025-12-10 15:52:12 +00:00
Updated Home (markdown)
parent
4290827bac
commit
a06d85617f
63
Home.md
63
Home.md
@ -3,50 +3,47 @@ Anyone can contribute to this wiki, so please feel free to correct any mistakes
|
||||
Z# Programming Language
|
||||
Z# is a programming language that was designed to be simple and easy to learn for beginner programmers. It is a high-level, interpreted language that has syntax similar to Python and JavaScript. Z# was created with the goal of making programming accessible to a wider audience, without sacrificing power and expressiveness.
|
||||
|
||||
Features
|
||||
Simple syntax
|
||||
Easy to learn
|
||||
High-level
|
||||
Interpreted
|
||||
Supports dynamic typing
|
||||
Object-oriented programming (OOP) support
|
||||
Garbage collection
|
||||
Cross-platform
|
||||
Hello World Example
|
||||
## Features
|
||||
* Simple syntax
|
||||
* Easy to learn
|
||||
* High-level
|
||||
* Interpreted
|
||||
* Supports dynamic typing
|
||||
* Object-oriented programming (OOP) support
|
||||
* Garbage collection
|
||||
* Cross-platform
|
||||
## Hello World Example
|
||||
Here is an example of a "Hello World" program in Z#:
|
||||
|
||||
lua
|
||||
Copy code
|
||||
output "Hello, World!";
|
||||
Data Types
|
||||
`output "Hello, World!";`
|
||||
> **Output (Z#'s answer to this code)**: "Hello, World"
|
||||
### Data Types
|
||||
|
||||
Z# supports several built-in data types:
|
||||
|
||||
string - a sequence of characters, enclosed in double quotes
|
||||
number - a numeric value
|
||||
boolean - a true/false value
|
||||
list - a collection of values, enclosed in square brackets and separated by commas
|
||||
Variables
|
||||
* string - a sequence of characters, enclosed in double quotes
|
||||
* number - a numeric value
|
||||
* boolean - a true/false value
|
||||
* list - a collection of values, enclosed in square brackets and separated by commas
|
||||
### Variables
|
||||
Variables in Z# are dynamically typed, meaning that the type of a variable is determined at runtime. Variables can be declared using the var keyword:
|
||||
|
||||
csharp
|
||||
Copy code
|
||||
var message = "Hello, World!";
|
||||
output message;
|
||||
Functions
|
||||
`var message = "Hello, World!";
|
||||
output message;`
|
||||
> **Output**: "Hello, World"
|
||||
### Functions
|
||||
Functions in Z# are defined using the func keyword:
|
||||
|
||||
scss
|
||||
Copy code
|
||||
func addNumbers(a, b) {
|
||||
`func addNumbers(a, b) {
|
||||
return a + b;
|
||||
}
|
||||
|
||||
output addNumbers(2, 3); // Output: 5
|
||||
Object-Oriented Programming (OOP)
|
||||
output addNumbers(2, 3);`
|
||||
> **Output**: 5
|
||||
### Object-Oriented Programming (OOP)
|
||||
Z# supports object-oriented programming (OOP) with classes and objects. Here is an example of a class in Z#:
|
||||
|
||||
kotlin
|
||||
Copy code
|
||||
***
|
||||
|
||||
class Person {
|
||||
constructor(name, age) {
|
||||
this.name = name;
|
||||
@ -60,5 +57,5 @@ class Person {
|
||||
|
||||
var person = new Person("Alice", 30);
|
||||
person.greet(); // Output: "Hello, my name is Alice and I am 30 years old."
|
||||
Conclusion
|
||||
## Conclusion
|
||||
Z# is a simple and easy-to-learn programming language that can be a great option for beginner programmers. Its high-level syntax and dynamic typing make it easy to get started with, while its support for object-oriented programming and garbage collection provide more advanced features for more experienced programmers.
|
||||
Loading…
x
Reference in New Issue
Block a user