mirror of
https://github.com/sam-astro/Z-Sharp.git
synced 2025-12-11 16:22: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# 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.
|
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
|
## Features
|
||||||
Simple syntax
|
* Simple syntax
|
||||||
Easy to learn
|
* Easy to learn
|
||||||
High-level
|
* High-level
|
||||||
Interpreted
|
* Interpreted
|
||||||
Supports dynamic typing
|
* Supports dynamic typing
|
||||||
Object-oriented programming (OOP) support
|
* Object-oriented programming (OOP) support
|
||||||
Garbage collection
|
* Garbage collection
|
||||||
Cross-platform
|
* Cross-platform
|
||||||
Hello World Example
|
## Hello World Example
|
||||||
Here is an example of a "Hello World" program in Z#:
|
Here is an example of a "Hello World" program in Z#:
|
||||||
|
|
||||||
lua
|
`output "Hello, World!";`
|
||||||
Copy code
|
> **Output (Z#'s answer to this code)**: "Hello, World"
|
||||||
output "Hello, World!";
|
### Data Types
|
||||||
Data Types
|
|
||||||
Z# supports several built-in data types:
|
Z# supports several built-in data types:
|
||||||
|
|
||||||
string - a sequence of characters, enclosed in double quotes
|
* string - a sequence of characters, enclosed in double quotes
|
||||||
number - a numeric value
|
* number - a numeric value
|
||||||
boolean - a true/false value
|
* boolean - a true/false value
|
||||||
list - a collection of values, enclosed in square brackets and separated by commas
|
* list - a collection of values, enclosed in square brackets and separated by commas
|
||||||
Variables
|
### 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:
|
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
|
`var message = "Hello, World!";
|
||||||
Copy code
|
output message;`
|
||||||
var message = "Hello, World!";
|
> **Output**: "Hello, World"
|
||||||
output message;
|
### Functions
|
||||||
Functions
|
|
||||||
Functions in Z# are defined using the func keyword:
|
Functions in Z# are defined using the func keyword:
|
||||||
|
|
||||||
scss
|
`func addNumbers(a, b) {
|
||||||
Copy code
|
|
||||||
func addNumbers(a, b) {
|
|
||||||
return a + b;
|
return a + b;
|
||||||
}
|
}
|
||||||
|
output addNumbers(2, 3);`
|
||||||
output addNumbers(2, 3); // Output: 5
|
> **Output**: 5
|
||||||
Object-Oriented Programming (OOP)
|
### Object-Oriented Programming (OOP)
|
||||||
Z# supports object-oriented programming (OOP) with classes and objects. Here is an example of a class in Z#:
|
Z# supports object-oriented programming (OOP) with classes and objects. Here is an example of a class in Z#:
|
||||||
|
|
||||||
kotlin
|
***
|
||||||
Copy code
|
|
||||||
class Person {
|
class Person {
|
||||||
constructor(name, age) {
|
constructor(name, age) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
@ -60,5 +57,5 @@ class Person {
|
|||||||
|
|
||||||
var person = new Person("Alice", 30);
|
var person = new Person("Alice", 30);
|
||||||
person.greet(); // Output: "Hello, my name is Alice and I am 30 years old."
|
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.
|
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