Compare commits

...

7 Commits

Author SHA1 Message Date
Luiz Bills
74d6f69853
Merge 68d2251332 into b03f9e0257 2024-12-03 14:27:04 +00:00
Boris Verkhovskiy
b03f9e0257 [jsonnet] syntax highlighting
All checks were successful
Trigger site build / deploy (push) Has been skipped
CI / lint (push) Successful in 18s
2024-12-02 00:04:24 -07:00
Boris Verkhovskiy
6872d7206a
Delete pogoscript (#5199)
All checks were successful
Trigger site build / deploy (push) Has been skipped
CI / lint (push) Successful in 19s
2024-12-01 16:56:35 -07:00
Boris Verkhovskiy
00e817db85 [brainfuck/*] syntax highlight
All checks were successful
Trigger site build / deploy (push) Has been skipped
CI / lint (push) Successful in 16s
2024-11-30 13:48:28 -07:00
Boris Verkhovskiy
1e27cd2fd1 Fix link 2024-11-30 13:33:16 -07:00
Luiz Bills
68d2251332
Merge branch 'adambard:master' into raylib-pt 2024-10-12 13:35:06 -03:00
Luiz Bills
5c3f5185b4 translate raylib to pt-br 2024-10-12 11:06:06 -03:00
19 changed files with 147 additions and 223 deletions

View File

@ -14,7 +14,7 @@ Turingovsky kompletní (ekvivalentní) programovací jazyk a má pouze 8 příka
Můžete si ho vyzkoušet přímo v prohlížeči s [brainfuck-visualizer](http://fatiherikli.github.io/brainfuck-visualizer/).
```
```bf
Jakýkoliv znak mimo "><+-.,[]" (bez uvozovek) je ignorován.
Brainfuck je reprezentován jako pole, které má 30.000 buněk s počátkem v nule

View File

@ -16,7 +16,7 @@ mit lediglich 8 Befehlen.
Mit dem [brainfuck-visualizer](http://fatiherikli.github.io/brainfuck-visualizer/) kann
Brainfuck im Browser ausprobiert werden.
```
```bf
Alle Zeichen außer "><+-.,[]" (ohne die Klammern) werden ignoriert.
Brainfuck besteht aus einem Array mit unendlich vielen Elementen, die alle mit Null initialisiert

View File

@ -15,7 +15,7 @@ lenguaje de programación extremadamente pequeño, Turing completo con sólo 8 c
Puedes probar brainfuck en tu navegador con [brainfuck-visualizer](http://fatiherikli.github.io/brainfuck-visualizer/).
```
```bf
Cualquier caracter que no sea "><+-.,[]" (sin incluir las comillas)
será ignorado.

View File

@ -33,7 +33,7 @@ lang: fa-ir
<p dir='rtl'>در اینجا یک برنامه ی ساره برین فاک را مشاهده میکنید.</p>
```
```bf
++++++ [ > ++++++++++ < - ] > +++++ .
```
@ -44,7 +44,7 @@ lang: fa-ir
<p dir='rtl'>-- و در انتهای حلقه به خانه ی اول برگشته تا حلقه کنترل شود</p>
<p dir='rtl'>بعد از اتمام حلقه به خانه ی دوم میرود و پنج بار به این خانه اضافه کرده و سپس آنرا چاپ میکند.</p>
```
```bf
, [ > + < - ] > .
```
@ -55,13 +55,13 @@ lang: fa-ir
<p dir='rtl'>توجه داشته باشید که ردر بالا فواصل بین دستور ها فقط برای خوانایی بیشتر گذاشته شده اند.</p>
<p dir='rtl'>در واقع برنامه بالا به شکل زیر صحیح می باشد.</p>
```
```bf
,[>+<-]>.
```
<p dir='rtl'>حال سعی کنید ببینید که برنامه ی زیر چه کاری انجام می دهد؟</p>
```
```bf
,>,< [ > [ >+ >+ << -] >> [- << + >>] <<< -] >>
```

View File

@ -12,7 +12,7 @@ lang: fr-fr
Brainfuck (sans majuscule à part au début dune phrase) est un langage
Turing-complet extrêmement simple avec seulement 8 commandes.
```
```bf
Tout caractère en dehors de "><+-.,[]" (en dehors des guillemets) est ignoré.
Brainfuck est représenté par un tableau de 30 000 cellules initialisées à 0 et

View File

@ -1,4 +1,4 @@
---
--
language: BF
filename: learnbf-it.bf
contributors:
@ -17,7 +17,7 @@ estremamente minimale, composto da solo 8 comandi.
Puoi provarlo nel tuo browser utilizzando
[brainfuck-visualizer](http://fatiherikli.github.io/brainfuck-visualizer/).
```
```bf
Qualsiasi carattere diverso da "><+-.,[]" (escludendo gli apici)
viene ignorato.
Branfuck è caratterizzato da un array di 30,000 celle inizializzate a zero

View File

@ -9,7 +9,7 @@ Jsonnet is a powerful templating language for JSON. Any valid JSON
document is a valid Jsonnet object. For an interactive demo/tutorial,
click [here](https://jsonnet.org/learning/tutorial.html)
```python
```jsonnet
// single line comment
/*

View File

@ -13,7 +13,7 @@ lang: ko-kr
Brainfuck(문장을 시작하는 단어가 아닌이상 첫글자는 대문자를 사용하지 않습니다)은
여덟가지 명령어만으로 튜링-완전한 최소주의 프로그래밍 언어입니다.
```
```bf
"><+-.,[]" 이외의 문자들은 무시됩니다. (쌍따옴표는 제외)
브레인퍽은 30,000 칸 짜리의 0으로 초기화된 배열과,

View File

@ -13,7 +13,7 @@ Brainfuck (schrijf je niet met een hoofdletter behalve aan het begin van een
zin) is een extreem
minimalistische Turing-complete programmeertaal met maar acht commando's.
```
```bf
Elk karakter behalve "><+-.,[]" (en de quotes) wordt genegeerd.
Brainfuck wordt gerepresenteerd door een array met 30.000 cellen die initieel

View File

@ -19,7 +19,7 @@ Zawiera zaledwie 8 poleceń.
Możesz przetesotwać brainfucka w swojej przeglądarce, korzystając z narzędzia
[brainfuck-visualizer](http://fatiherikli.github.io/brainfuck-visualizer/).
```
```bf
Wszystkie znaki oprócz "><+-.,[]" (wyłączając znaki zapytania) są ignorowane.
Pamięć w brainfucku jest reprezentowana przez tablicę 30.000 komórek

View File

@ -1,202 +0,0 @@
---
language: PogoScript
contributors:
- ["Tim Macfarlane", "http://github.com/refractalize"]
filename: learnPogo.pogo
---
Pogoscript is a little language that emphasises readability, DSLs and provides excellent asynchronous primitives for writing connected JavaScript applications for the browser or server.
``` javascript
// defining a variable
water temperature = 24
// re-assigning a variable after its definition
water temperature := 26
// functions allow their parameters to be placed anywhere
temperature at (a) altitude = 32 - a / 100
// longer functions are just indented
temperature at (a) altitude :=
if (a < 0)
water temperature
else
32 - a / 100
// calling a function
current temperature = temperature at 3200 altitude
// this function constructs a new object with methods
position (x, y) = {
x = x
y = y
distance from position (p) =
dx = self.x - p.x
dy = self.y - p.y
Math.sqrt (dx * dx + dy * dy)
}
// `self` is similar to `this` in JavaScript with the
// exception that `self` isn't redefined in each new
// function definition
// `self` just does what you expect
// calling methods
position (7, 2).distance from position (position (5, 1))
// as in JavaScript, objects are hashes too
position.'x' == position.x == position.('x')
// arrays
positions = [
position (1, 1)
position (1, 2)
position (1, 3)
]
// indexing an array
positions.0.y
n = 2
positions.(n).y
// strings
poem = 'Tail turned to red sunset on a juniper crown a lone magpie cawks.
Mad at Oryoki in the shrine-room -- Thistles blossomed late afternoon.
Put on my shirt and took it off in the sun walking the path to lunch.
A dandelion seed floats above the marsh grass with the mosquitos.
At 4 A.M. the two middleaged men sleeping together holding hands.
In the half-light of dawn a few birds warble under the Pleiades.
Sky reddens behind fir trees, larks twitter, sparrows cheep cheep cheep
cheep cheep.'
// that's Allen Ginsburg
// interpolation
outlook = 'amazing!'
console.log "the weather tomorrow is going to be #(outlook)"
// regular expressions
r/(\d+)m/i
r/(\d+) degrees/mg
// operators
true @and true
false @or true
@not false
2 < 4
2 >= 2
2 > 1
// plus all the javascript ones
// to define your own
(p1) plus (p2) =
position (p1.x + p2.x, p1.y + p2.y)
// `plus` can be called as an operator
position (1, 1) @plus position (0, 2)
// or as a function
(position (1, 1)) plus (position (0, 2))
// explicit return
(x) times (y) = return (x * y)
// new
now = @new Date ()
// functions can take named optional arguments
spark (position, color: 'black', velocity: {x = 0, y = 0}) = {
color = color
position = position
velocity = velocity
}
red = spark (position 1 1, color: 'red')
fast black = spark (position 1 1, velocity: {x = 10, y = 0})
// functions can unsplat arguments too
log (messages, ...) =
console.log (messages, ...)
// blocks are functions passed to other functions.
// This block takes two parameters, `spark` and `c`,
// the body of the block is the indented code after the
// function call
render each @(spark) into canvas context @(c)
ctx.begin path ()
ctx.stroke style = spark.color
ctx.arc (
spark.position.x + canvas.width / 2
spark.position.y
3
0
Math.PI * 2
)
ctx.stroke ()
// asynchronous calls
// JavaScript both in the browser and on the server (with Node.js)
// makes heavy use of asynchronous IO with callbacks. Async IO is
// amazing for performance and making concurrency simple but it
// quickly gets complicated.
// Pogoscript has a few things to make async IO much much easier
// Node.js includes the `fs` module for accessing the file system.
// Let's list the contents of a directory
fs = require 'fs'
directory listing = fs.readdir! '.'
// `fs.readdir()` is an asynchronous function, so we can call it
// using the `!` operator. The `!` operator allows you to call
// async functions with the same syntax and largely the same
// semantics as normal synchronous functions. Pogoscript rewrites
// it so that all subsequent code is placed in the callback function
// to `fs.readdir()`.
// to catch asynchronous errors while calling asynchronous functions
try
another directory listing = fs.readdir! 'a-missing-dir'
catch (ex)
console.log (ex)
// in fact, if you don't use `try catch`, it will raise the error up the
// stack to the outer-most `try catch` or to the event loop, as you'd expect
// with non-async exceptions
// all the other control structures work with asynchronous calls too
// here's `if else`
config =
if (fs.stat! 'config.json'.is file ())
JSON.parse (fs.read file! 'config.json' 'utf-8')
else
{
color: 'red'
}
// to run two asynchronous calls concurrently, use the `?` operator.
// The `?` operator returns a *future* which can be executed to
// wait for and obtain the result, again using the `!` operator
// we don't wait for either of these calls to finish
a = fs.stat? 'a.txt'
b = fs.stat? 'b.txt'
// now we wait for the calls to finish and print the results
console.log "size of a.txt is #(a!.size)"
console.log "size of b.txt is #(b!.size)"
// futures in Pogoscript are analogous to Promises
```
That's it.
Download [Node.js](http://nodejs.org/) and `npm install pogo`.
There is plenty of documentation on [http://pogoscript.org/](http://pogoscript.org/), including a [cheat sheet](http://pogoscript.org/cheatsheet.html), a [guide](http://pogoscript.org/guide/), and how [Pogoscript translates to Javascript](http://featurist.github.io/pogo-examples/). Get in touch on the [google group](http://groups.google.com/group/pogoscript) if you have questions!

View File

@ -0,0 +1,126 @@
---
category: framework
framework: raylib
filename: learnraylib-pt.c
contributors:
- ["Nikolas Wipper", "https://notnik.cc"]
lang: pt-br
translators:
- ["Luiz Bills", "https://github.com/luizbills"]
---
**raylib** é uma biblioteca gráfica multiplataforma fácil de usar, construída em torno do OpenGL 1.1, 2.1, 3.3 e OpenGL ES 2.0. Embora seja escrito em C, possui *bindings* em mais de 50 linguages diferentes. Este tutorial usará C, mais especificamente C99.
```c
#include <raylib.h>
int main(void)
{
const int larguraJanela = 800;
const int alturaJanela = 450;
// Antes de iniciar a raylib nós podemos definir algumas configurações
SetConfigFlags(FLAG_MSAA_4X_HINT | FLAG_VSYNC_HINT);
// raylib não necessita que salvamos nenhuma instância
// até o momento raylib só pode ter controlar uma janela por vez
InitWindow(larguraJanela, alturaJanela, "MinhaJanela");
// Faz nosso jogo rodar a 60 quadros por segundo (60 FPS)
SetTargetFPS(60);
// Define uma tecla para fechar a janela do jogo
// Use 0 para nenhuma tecla
SetExitKey(KEY_DELETE);
// raylib tem dois tipos de cameras: Camera3D e Camera2D
// Camera é um typedef da Camera3D
Camera camera = {
.position = {0.0f, 0.0f, 0.0f},
.target = {0.0f, 0.0f, 1.0f},
.up = {0.0f, 1.0f, 0.0f},
.fovy = 70.0f,
.projection = CAMERA_PERSPECTIVE
};
// raylib suporta carregar modelos, animações, imagens and sons
// de vários formatos de arquivos diferentes
Model myModel = LoadModel("my_model.obj");
Font someFont = LoadFont("some_font.ttf");
// WindowShouldClose() checa se estão tentando fechar a janela
while (!WindowShouldClose())
{
// BeginDrawing() precisa se chamado antes de renderizar
// qualquer coisa na tela
BeginDrawing();
{
// Define uma cor de fundo
ClearBackground(BLACK);
// checa se uma tecla está sendo pressionada
if (IsKeyDown(KEY_SPACE)) {
// Mostra um circulo
DrawCircle(
400, // posição x
400, // posição y
30, // raio
GREEN // cor verde
);
// Para muitas funções haverá diversas versões
// Que terão os sufixos Ex, Pro, V, Lines (apenas 2D),
// or algumas vezes Rec, Wires (apenas 3D)
DrawCircleLines(
200, // posição x
200, // posição y
35, // raio
LIGHTGRAY // cor cinza claro
);
}
// Mostra um texto
DrawText("Parabéns! Você criou sua primeira janela!",
190, // posição x
200, // posição y
20, // tamanho da fonte
LIGHTGRAY // cor
);
// Obrigatório para gráficos 3D, também tem 2D
BeginMode3D(camera);
{
// desenha um cubo
DrawCube(
(Vector3) {0.0f, 0.0f, 5.0f},
1.0f,
1.0f,
1.0f,
RED
);
}
// Encerra o modo 3D
EndMode3D();
}
// EndDrawing() precisa se chamado depos de renderizar tudo
EndDrawing();
}
// Descarrega (limpa da memória) objetos carregados
UnloadFont(someFont);
UnloadModel(myModel);
// Fecha a janela e encerra o contexto OpenGL
CloseWindow();
return 0;
}
```
## Continue lendo
No site oficial da raylib tem [ótimos exemplos](https://www.raylib.com/examples.html).
Se você não gosta de linguagem C você pode usar com outras linguagens usando [bindings](https://github.com/raysan5/raylib/blob/master/BINDINGS.md).

View File

@ -12,7 +12,7 @@ lang: pt-pt
Brainfuck (não capitalizado excepto no início de uma frase) é uma linguagem de
programação Turing-completa extremamente simples com apenas 8 comandos.
```
```bf
Qualquer caractere excepto "><+-.,[]" (não contar com as aspas) é ignorado.
Brainfuck é representado por um vector com 30 000 células inicializadas a zero

View File

@ -14,7 +14,7 @@ Brainfuck (пишется маленькими буквами, кроме нач
Вы можете испытать brainfuck в вашем браузере с помощью [brainfuck-визуализатора](http://fatiherikli.github.io/brainfuck-visualizer/).
```
```bf
Любой символ, кроме "><+-.,[]", игнорируется, за исключением кавычек.
Brainfuck представлен массивом из 30000 ячеек, инициализированных нулями,

View File

@ -14,7 +14,7 @@ minimalistiskt Turing-komplett programmeringsspråk med endast 8 kommandon.
Du kan testa brainfuck i din webbläsare via [brainfuck-visualizer](http://fatiherikli.github.io/brainfuck-visualizer/).
```
```bf
Alla karaktärer förutom "><+-.,[]" (inte inkluderat citattecken) ignoreras.
Brainfuck är representerat av ett fält med 30 000 celler initialiserade till

View File

@ -12,7 +12,7 @@ Brainfuck (normalde brainfuck olarak bütün harfleri küçük olarak yazılır.
son derece minimal bir programlama dilidir. (Sadece 8 komut) ve tamamen
Turing'dir.
```
```bf
"><+-.,[]" (tırnak işaretleri hariç) karakterleri dışındaki her karakter
gözardı edilir.

View File

@ -3,7 +3,7 @@ language: F#
contributors:
- ["Scott Wlaschin", "http://fsharpforfunandprofit.com/"]
translators:
- ["Mustafa Zengin", "http://zengin.github.com/"]
- ["Mustafa Zengin", "http://zengin.github.io/"]
filename: learnfsharp-tr.fs
lang: tr-tr
---

View File

@ -3,7 +3,7 @@ language: TypeScript
contributors:
- ["Philippe Vlérick", "https://github.com/pvlerick"]
translators:
- ["Mustafa Zengin", "http://zengin.github.com"]
- ["Mustafa Zengin", "http://zengin.github.io"]
filename: learntypescript-tr.ts
lang: tr-tr
---

View File

@ -12,7 +12,7 @@ lang: zh-cn
Brainfuck 是一个极小的只有8个指令的图灵完全的编程语言。
```
```bf
除"><+-.,[]"之外的的任何字符都会被忽略 (不包含双引号)。
Brainfuck 包含一个有30,000个单元为0的数组