Compare commits

...

6 Commits

Author SHA1 Message Date
Piyush Ranjan
ca2852a1e5
Merge eeb513929b into b03f9e0257 2024-12-03 17:15:21 +01: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
Piyush Ranjan
eeb513929b
Correct OCaml record field assignment syntax
Fixed an error in the OCaml article where record field assignments incorrectly used `:` instead of `=`.
Updated example:
```ocaml
let cow = { name = "cow"; color = "brown"; legs = 4 };;
2024-11-23 14:39:44 +05:30
19 changed files with 25 additions and 227 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

@ -341,9 +341,9 @@ type animal =
;;
let cow =
{ name: "cow";
color: "black and white";
legs: 4;
{ name = "cow";
color = "black and white";
legs = 4;
}
;;
val cow : animal
@ -488,7 +488,7 @@ filter (fun x -> x < 4) [3; 1; 4; 1; 5] ;; (* Gives [3; 1; 1]) *)
(* However, you can create mutable polymorphic fields *)
type counter = { mutable num : int } ;;
let c = { num: 0 } ;;
let c = { num = 0 } ;;
c.num ;; (* Gives 0 *)
c.num <- 1 ;; (* <- operator can set mutable record fields *)
c.num ;; (* Gives 1 *)

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

@ -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的数组