Skip to content
Merged
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
18 changes: 18 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,24 @@ Please ensure your pull request adheres to the following guidelines:
* New example or improvements to existing examples are welcome.
* Please check your spelling and grammar.

## A Note on Example Versions
All examples should include the following header:

```markdown
---
version: 3.5.1
example_title: JSON
---
```

Change the `version` attribute according to the following rules:

* MAJOR — You (re)wrote the whole thing. Your new content will need some translation.
* MINOR — Added or removed some content, few sentences, etc.
* PATCH — Spelling, typos. Probably not translated stuff.

We follow SemVer.org pattern. This is important because we use that to determine and inform translators of new content that requires translation.

## Adding a New Example

To add a new example, create a new folder and a file or a file (depending upon the example) under the appropriate directory in `./examples`. Please check the `.plan` file to see what examples we plan to create. Feel free to work on any pending examples. We're happy to read/review your changes and collaborate/code with you to merge them.
Expand Down
5 changes: 5 additions & 0 deletions cn/examples/section_1/comment.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: 注释
---

# 注释

V支持单行注释`//`和多行注释`/**/`。
Expand Down
5 changes: 5 additions & 0 deletions cn/examples/section_1/hello_world.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: 格式化打印
---

# 格式化打印

打印由各种I/O流函数处理。人们应该要知道如何去使用它们。
Expand Down
5 changes: 5 additions & 0 deletions cn/examples/section_1/keywords.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: 关键字
---

# 关键字

V是一种非常小巧的语言,所以它很少有关键字。大约有25个关键字。
Expand Down
5 changes: 5 additions & 0 deletions cn/examples/section_1/primitives.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: Primitives
---

# Primitives

V的基本类型比Go少。
Expand Down
5 changes: 5 additions & 0 deletions cn/examples/section_1/strings.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: 字符串
---

# 字符串

在V中,可以使用`:=`运算符定义字符串。默认情况下,字符串(与其他变量一样)是不可变的。
Expand Down
5 changes: 5 additions & 0 deletions cn/examples/section_1/variables.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: 变量
---

# 变量

在V语言中,变量可以用`:=`运算符声明和初始化。变量只能以这种方式在V中声明,这意味着所有变量都有一个初始值。变量的类型是从右边的值推断出来的。默认情况下,V中的变量是不可变的。
Expand Down
5 changes: 5 additions & 0 deletions cn/examples/section_2/if-else.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: If语句
---

# If语句

## `if` 表达式
Expand Down
5 changes: 5 additions & 0 deletions cn/examples/section_2/loops.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: 循环结构
---

# 循环结构

在V语言中只有一种类型的循环,像Go一样,它可以在很多方面使用。
Expand Down
5 changes: 5 additions & 0 deletions cn/examples/section_2/match.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: Match
---

# Match

## match语句
Expand Down
5 changes: 5 additions & 0 deletions cn/examples/section_2/operator.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: 运算符
---

# 运算符

V支持以下运算符:
Expand Down
5 changes: 5 additions & 0 deletions cn/examples/section_3/arrays.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: 数组
---

# 数组

数组是存储在连续内存位置的项的集合。它是一个聚合数据结构,旨在存储一组相同类型的对象。它是存储和访问一系列对象的最有效的数据结构。
Expand Down
5 changes: 5 additions & 0 deletions cn/examples/section_3/functions.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: Functions
---

# Functions

函数是一个有组织、可重用的代码块,用于执行单个相关操作。
Expand Down
5 changes: 5 additions & 0 deletions cn/examples/section_3/methods.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: Methods
---

# Methods

V没有Class。但是可以为类型定义方法。
Expand Down
5 changes: 5 additions & 0 deletions cn/examples/section_3/struct.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: Struct
---

# Struct

struct是一种复合数据类型(或记录)声明,它在内存块中的一个名称下定义物理分组的变量列表,允许通过单个指针或通过返回相同地址的struct声明的名称访问不同的变量。
Expand Down
5 changes: 5 additions & 0 deletions cn/examples/section_4/array-functions.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: 数组函数
---

# 数组函数

## `repeat`
Expand Down
7 changes: 6 additions & 1 deletion cn/examples/section_4/files.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: 文件操作
---

# 文件操作

V中的文件是程序可访问的任何文件对象的抽象,与`os`库密切相关。
Expand Down Expand Up @@ -76,4 +81,4 @@ fn read_file(path string) {
1.编写一个V程序来创建一个包含内容的新文件。
2.编写一个V程序来读取两个不同的文件并显示其内容。
3.阅读V中“os”库的工作原理,了解如何使用它。
4.编码一个嵌套的json字符串并用结果编写一个新文件。
4.编码一个嵌套的json字符串并用结果编写一个新文件。
5 changes: 5 additions & 0 deletions cn/examples/section_4/testing.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: 测试
---

# 测试

软件开发中的测试是一个过程,其目的是评估应用程序的功能,以确定代码是否满足指定的要求,并确定问题,以确保产品具有预期的质量。
Expand Down
5 changes: 5 additions & 0 deletions de/examples/section_1/comment.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: Kommentare
---

# Kommentare

V bietet die Möglichkeit Zeilenkommentare mit `//` und mehrzeilige Kommentare mit `/* */` zu erzeugen.
Expand Down
5 changes: 5 additions & 0 deletions de/examples/section_1/hello_world.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: Formatted Print
---

# Formatted Print

Konsolenausgaben werden durch verschiedene I/O-Streams gehandhabt, dazu sollte man wissen, wo und wie sie zu verwenden sind.
Expand Down
5 changes: 5 additions & 0 deletions de/examples/section_1/keywords.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: Schlüsselwörter
---

# Schlüsselwörter

V ist eine kleine Programmiersprache mit wenigen Schlüsselwörtern (circa 23 Stück).
Expand Down
5 changes: 5 additions & 0 deletions de/examples/section_1/primitives.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: Datentypen
---

# Primitive Datentypen

V hat weniger primitive Datentypen als Go.
Expand Down
5 changes: 5 additions & 0 deletions de/examples/section_1/strings.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: Strings
---

# Strings

In V können Strings mit dem Deklarationsoperator (`:=`) deklariert und initialisiert werden und sind, wie andere Variablen in V auch, standardmäßig `immutable`, d.h. unveränderlich.
Expand Down
5 changes: 5 additions & 0 deletions de/examples/section_1/variables.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: Variables
---

# Variables

Variablen können in V mit dem `:=` Operator deklariert und initialisiert werden.
Expand Down
5 changes: 5 additions & 0 deletions de/examples/section_2/if-else.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: If statement
---

# If statement

## The `if` statement
Expand Down
5 changes: 5 additions & 0 deletions de/examples/section_2/loops.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: Looping Constructs
---

# Looping Constructs

There's only one type of loop in V language, like Go which can be used in many ways.
Expand Down
5 changes: 5 additions & 0 deletions de/examples/section_2/match.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: Match
---

# Match

## The `match` statement
Expand Down
5 changes: 5 additions & 0 deletions de/examples/section_2/operator.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: Operators
---

# Operators

V bietet die folgenden Operatoren:
Expand Down
5 changes: 5 additions & 0 deletions de/examples/section_3/arrays.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: Arrays
---

# Arrays

An array is a collection of items stored in contiguous memory locations. It's an aggregate data structure that is designed to store a group of objects of the same type. It's the most efficient data structure for storing and accessing a sequence of objects.
Expand Down
5 changes: 5 additions & 0 deletions de/examples/section_3/functions.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: Functions
---

# Functions

A function is a block of organized, reusable code that is used to perform a single, related action.
Expand Down
5 changes: 5 additions & 0 deletions de/examples/section_3/methods.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: Methods
---

# Methods

V does not have classes. But one can define methods for types.
Expand Down
5 changes: 5 additions & 0 deletions de/examples/section_3/struct.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: Struct
---

# Struct

A struct is a composite data type (or record) declaration that defines a physically grouped list of variables under one name in a block of memory, allowing different variables to be accessed via a single pointer or by the struct declared name which returns the same address.
Expand Down
5 changes: 5 additions & 0 deletions de/examples/section_4/array-functions.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: Array Functions
---

# Array Functions

## `repeat`
Expand Down
5 changes: 5 additions & 0 deletions de/examples/section_4/files.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: Files
---

# Files

A File in V is an abstraction of any file object accessible by the program and is closely associated with `os` library.
Expand Down
5 changes: 5 additions & 0 deletions de/examples/section_4/json.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: JSON
---

# JSON

JavaScript Object Notation (JSON) is a lightweight data-interchange format that is easy for humans to read and write. Furthermore, equally simple for machines to generate and/or parse.
Expand Down
5 changes: 5 additions & 0 deletions de/examples/section_4/testing.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: Testing
---

# Testing

Testing in software development is a process that aims to evaluate the functionality of an application with an intent to find whether the code met the specified requirements or not as well as identifying the problems to ensure that the product has expected quality.
Expand Down
5 changes: 5 additions & 0 deletions en/examples/section_1/comment.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: Comments
---

# Comments

V supports single line comments `//` and multi-line comments `/* */`.
Expand Down
5 changes: 5 additions & 0 deletions en/examples/section_1/hello_world.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: Hello World
---

# Formatted Print

Printing is handled by various I/O stream functions. One should know where to use them accordingly.
Expand Down
5 changes: 5 additions & 0 deletions en/examples/section_1/keywords.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: Keywords
---

# Keywords

V is a very small language so it has few keywords. There are around 25 keywords.
Expand Down
5 changes: 5 additions & 0 deletions en/examples/section_1/primitives.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: Primitives
---

# Primitives

V has less primitive types than Go.
Expand Down
5 changes: 5 additions & 0 deletions en/examples/section_1/strings.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
version: 1.0.0
example_title: Strings
---

# Strings

In V one can define strings using the `:=` operator. Strings (like other variables) are immutable by default. One is free to use `""` or `''` to denote a string. When using `vfmt` all double-quoted strings will be converted to single-quoted ones unless it contains a single quote character.
Expand Down
Loading