diff options
| -rw-r--r-- | bash.html.markdown | 64 | ||||
| -rw-r--r-- | brainfuck.html.markdown | 14 | ||||
| -rw-r--r-- | csharp.html.markdown | 81 | ||||
| -rw-r--r-- | ko-kr/brainfuck-kr.html.markdown | 83 | ||||
| -rw-r--r-- | pogo.html.markdown | 202 | ||||
| -rw-r--r-- | tr-tr/brainfuck-tr.html.markdown | 57 | 
6 files changed, 444 insertions, 57 deletions
| diff --git a/bash.html.markdown b/bash.html.markdown index 708131bd..4d80545e 100644 --- a/bash.html.markdown +++ b/bash.html.markdown @@ -4,6 +4,7 @@ tool: bash  contributors:      - ["Max Yankov", "https://github.com/golergka"]      - ["Darren Lin", "https://github.com/CogBear"] +    - ["Alexandre Medeiros", "http://alemedeiros.sdf.org"]  filename: LearnBash.sh  --- @@ -35,8 +36,22 @@ VARIABLE = "Some string"  # Using the variable:  echo $VARIABLE  echo "$VARIABLE" +echo '$VARIABLE'  # When you use the variable itself — assign it, export it, or else — you write  # its name without $. If you want to use variable's value, you should use $. +# Note that ' (single quote) won't expand the variables! + +# String substitution in variables +echo ${VARIABLE/Some/A} +# This will substitute the first occurance of "Some" with "A" + +# Bultin variables: +# There are some useful builtin variables, like +echo "Last program return value: $?" +echo "Script's PID: $$" +echo "Number of arguments: $#" +echo "Scripts arguments: $@" +echo "Scripts arguments separeted in different variables: $1 $2..."  # Reading a value from input:  echo "What's your name?" @@ -44,13 +59,18 @@ read NAME # Note that we didn't need to declare new variable  echo Hello, $NAME!  # We have the usual if structure: -if true +# use 'man test' for more info about conditionals +if [ $NAME -ne $USER ]  then -    echo "This is expected" +    echo "Your name is you username"  else -    echo "And this is not" +    echo "Your name isn't you username"  fi +# There is also conditional execution +echo "Always executed" || echo "Only executed if first command fail" +echo "Always executed" && echo "Only executed if first command does NOT fail" +  # Expressions are denoted with the following format:  echo $(( 10 + 5 )) @@ -67,6 +87,13 @@ ls -l # Lists every file and directory on a separate line  # txt files in the current directory:  ls -l | grep "\.txt" +# You can also redirect a command output, input and error output. +python2 hello.py < "input.in" +python2 hello.py > "output.out" +python2 hello.py 2> "error.err" +# The output error will overwrite the file if it exists, if you want to +# concatenate them, use ">>" instead. +  # Commands can be substitued within other commands using $( ):  # The following command displays the number of files and directories in the  # current directory. @@ -80,11 +107,36 @@ case "$VARIABLE" in      *) echo "It is not null.";;  esac -#For loops iterate for as many arguments given: -#The contents of var $VARIABLE is printed three times. -for VARIABLE in x y z +# For loops iterate for as many arguments given: +# The contents of var $VARIABLE is printed three times. +# Note that ` ` is equivalent to $( ) and that seq returns a sequence of size 3. +for VARIABLE in `seq 3`  do      echo "$VARIABLE"  done +# You can also define functions +# Definition: +foo () +{ +    echo "Arguments work just like script arguments: $@" +    echo "And: $1 $2..." +    echo "This is a function" +    return 0 +} + +# Calling your function +foo "My name is" $NAME + +# There are a lot of useful commands you should learn: +tail -n 10 file.txt +# prints last 10 lines of file.txt +head -n 10 file.txt +# prints first 10 lines of file.txt +sort file.txt +# sort file.txt's lines +uniq -d file.txt +# report or omit repeated lines, with -d it reports them +cut -d ',' -f 1 file.txt +# prints only the first column before the ',' character  ``` diff --git a/brainfuck.html.markdown b/brainfuck.html.markdown index 9282381f..27ac6921 100644 --- a/brainfuck.html.markdown +++ b/brainfuck.html.markdown @@ -53,25 +53,27 @@ until cell #1 is 0, and cell #2 holds cell #1's old value. Because we're on  cell #1 at the end of the loop, move to cell #2, and then print out the value  in ASCII. -Also keep in mind that the spaces are purely for readibility purposes. You  +Also keep in mind that the spaces are purely for readability purposes. You  could just as easily write it as:  ,[>+<-]>.  Try and figure out what this program does: -,>,< [ > [ >+ >+ << -] >> [- << + >>] <<< -] >>   +,>,< [ > [ >+ >+ << -] >> [- << + >>] <<< -] >>  This program takes two numbers for input, and multiplies them.  The gist is it first reads in two inputs. Then it starts the outer loop,  conditioned on cell #1. Then it moves to cell #2, and starts the inner -loop conditioned on cell #2, incrementing cell #3. However, there comes a  -problem: at the end of the inner loop, cell #2 is zero. To solve this problem, +loop conditioned on cell #2, incrementing cell #3. However, there comes a +problem: At the end of the inner loop, cell #2 is zero. In that case, +inner loop won't work anymore since next time. To solve this problem,  we also increment cell #4, and then recopy cell #4 into cell #2. +Then cell #3 is the result.  ``` -And that's brainfuck. Not that hard, eh? For fun, you can write your own  -brainfuck programs, or you can write a brainfuck interpreter in another  +And that's brainfuck. Not that hard, eh? For fun, you can write your own +brainfuck programs, or you can write a brainfuck interpreter in another  language. The interpreter is fairly simple to implement, but if you're a  masochist, try writing a brainfuck interpreter… in brainfuck. diff --git a/csharp.html.markdown b/csharp.html.markdown index d3adbd01..1471b833 100644 --- a/csharp.html.markdown +++ b/csharp.html.markdown @@ -3,6 +3,7 @@ language: c#  contributors:      - ["Irfan Charania", "https://github.com/irfancharania"]      - ["Max Yankov", "https://github.com/golergka"] +	- ["Melvyn Laïly", "http://x2a.yt"]  filename: LearnCSharp.cs  --- @@ -95,17 +96,25 @@ namespace Learning              // Double - Double-precision 64-bit IEEE 754 Floating Point              // Precision: 15-16 digits              double fooDouble = 123.4; +			 +			// Decimal - a 128-bits data type, with more precision than other floating-point types, +			// suited for financial and monetary calculations +			decimal fooDecimal = 150.3m; -            // Bool - true & false +            // Boolean - true & false              bool fooBoolean = true;              bool barBoolean = false;              // Char - A single 16-bit Unicode character              char fooChar = 'A'; -            // Strings +            // Strings -- unlike the previous base types which are all value types, +			// a string is a reference type. That is, you can set it to null              string fooString = "My string is here!";              Console.WriteLine(fooString); +			// You can access each character of the string with an indexer: +			char charFromString = fooString[1]; // 'y' +			// Strings are immutable: you can't do fooString[1] = 'X';              // formatting              string fooFs = string.Format("Check Check, {0} {1}, {0} {1:0.0}", 1, 2); @@ -138,14 +147,21 @@ namespace Learning              const int HOURS_I_WORK_PER_WEEK = 9001;              // Nullable types -            // any type can be made nullable by suffixing a ? +            // any value type (i.e. not a class) can be made nullable by suffixing a ?              // <type>? <var name> = <value>              int? nullable = null;              Console.WriteLine("Nullable variable: " + nullable); -            // In order to use nullable's value, you have to use Value property or to explicitly cast it -            string? nullableString = "not null"; -            Console.WriteLine("Nullable value is: " + nullableString.Value + " or: " + (string) nullableString ); +            // In order to use nullable's value, you have to use Value property +			// or to explicitly cast it +            DateTime? nullableDate = null;  +			// The previous line would not have compiled without the '?' +			// because DateTime is a value type +			// <type>? is equivalent to writing Nullable<type> +			Nullable<DateTime> otherNullableDate = nullableDate; +			 +			nullableDate = DateTime.Now; +            Console.WriteLine("Nullable value is: " + nullableDate.Value + " or: " + (DateTime) nullableDate );              // ?? is syntactic sugar for specifying default value              // in case variable is null @@ -153,6 +169,8 @@ namespace Learning              Console.WriteLine("Not nullable variable: " + notNullable);              // Var - compiler will choose the most appropriate type based on value +			// Please note that this does not remove type safety. +			// In this case, the type of fooImplicit is known to be a bool at compile time              var fooImplicit = true;              /////////////////////////////////////////////////// @@ -201,7 +219,7 @@ namespace Learning              // Others data structures to check out:              //              // Stack/Queue -            // Dictionary +            // Dictionary (an implementation of a hash map)              // Read-only Collections              // Tuple (.Net 4+) @@ -235,7 +253,6 @@ namespace Learning              ~       Unary bitwise complement              <<      Signed left shift              >>      Signed right shift -            >>>     Unsigned right shift              &       Bitwise AND              ^       Bitwise exclusive OR              |       Bitwise inclusive OR @@ -308,6 +325,18 @@ namespace Learning                  //Iterated 10 times, fooFor 0->9              }              Console.WriteLine("fooFor Value: " + fooFor); +			 +			// For Each Loop +            // foreach loop structure => foreach(<iteratorType> <iteratorName> in <enumerable>) +			// The foreach loop loops over any object implementing IEnumerable or IEnumerable<T> +			// All the collection types (Array, List, Dictionary...) in the .Net framework +			// implement one or both of these interfaces. +			// (The ToCharArray() could be removed, because a string also implements IEnumerable) +            foreach (char character in "Hello World".ToCharArray()) +            { +                //Console.WriteLine(character); +                //Iterated over all the characters in the string +            }              // Switch Case              // A switch works with the byte, short, char, and int data types. @@ -327,6 +356,14 @@ namespace Learning                  case 3:                      monthString = "March";                      break; +				// You can assign more than one case to an action +				// But you can't add an action without a break before another case +				// (if you want to do this, you would have to explicitly add a goto case x +				case 6: +				case 7: +				case 8: +					monthString = "Summer time!!"; +					break;                  default:                      monthString = "Some other month";                      break; @@ -335,7 +372,7 @@ namespace Learning              /////////////////////////////////////// -            // Converting Data Types And Typcasting +            // Converting Data Types And Typecasting              ///////////////////////////////////////              // Converting data @@ -389,7 +426,7 @@ namespace Learning      // Class Declaration Syntax: -    // <public/private/protected> class <class name>{ +    // <public/private/protected/internal> class <class name>{      //    //data fields, constructors, functions all inside.      //    //functions are called as methods in Java.      // } @@ -404,17 +441,20 @@ namespace Learning          string name; // Everything is private by default: Only accessible from within this class          // Enum is a value type that consists of a set of named constants +		// It is really just mapping a name to a value (an int, unless specified otherwise). +		// The approved types for an enum are byte, sbyte, short, ushort, int, uint, long, or ulong. +		// An enum can't contain the same value twice.          public enum Brand          {              AIST,              BMC, -            Electra, +            Electra=42, //you can explicitly set a value to a name              Gitane          }          // We defined this type inside a Bicycle class, so it is a nested type          // Code outside of this class should reference this type as Bicycle.Brand -        public Brand brand; // After declaing an enum type, we can declare the field of this type +        public Brand brand; // After declaring an enum type, we can declare the field of this type          // Static members belong to the type itself rather then specific object.          static public int bicyclesCreated = 0; @@ -459,7 +499,7 @@ namespace Learning          // <public/private/protected> <return type> <function name>(<args>)          // classes can implement getters and setters for their fields -        // or they can implement properties +        // or they can implement properties (this is the preferred way in C#)          // Method declaration syntax:          // <scope> <return type> <method name>(<args>) @@ -474,13 +514,14 @@ namespace Learning              cadence = newValue;          } -        // virtual keyword indicates this method can be overridden +        // virtual keyword indicates this method can be overridden in a derived class          public virtual void SetGear(int newValue)          {              gear = newValue;          } -        // Method parameters can have defaut values. In this case, methods can be called with these parameters omitted +        // Method parameters can have default values. +		// In this case, methods can be called with these parameters omitted          public void SpeedUp(int increment = 1)          {              _speed += increment; @@ -500,6 +541,12 @@ namespace Learning              get { return _hasTassles; }              set { _hasTassles = value; }          } +		 +		// You can also define an automatic property in one line +		// this syntax will create a backing field automatically. +		// You can set an access modifier on either the getter or the setter (or both) +		// to restrict its access: +		public bool IsBroken { get; private set; }          // Properties can be auto-implemented          public int FrameSize @@ -525,7 +572,7 @@ namespace Learning          // Methods can also be static. It can be useful for helper methods          public static bool DidWeCreateEnoughBycles()          { -            // Within a static method, we only can reference static class memebers +            // Within a static method, we only can reference static class members              return bicyclesCreated > 9000;          } // If your class only needs static members, consider marking the class itself as static. @@ -564,7 +611,7 @@ namespace Learning      interface IBreakable      { -        bool Broken { get; } // interfaces can contain properties as well as methods, fields & events +        bool Broken { get; } // interfaces can contain properties as well as methods & events      }      // Class can inherit only one other class, but can implement any amount of interfaces diff --git a/ko-kr/brainfuck-kr.html.markdown b/ko-kr/brainfuck-kr.html.markdown new file mode 100644 index 00000000..661fcfea --- /dev/null +++ b/ko-kr/brainfuck-kr.html.markdown @@ -0,0 +1,83 @@ +--- +language: brainfuck +contributors: +    - ["Prajit Ramachandran", "http://prajitr.github.io/"] +    - ["Mathias Bynens", "http://mathiasbynens.be/"] +translators: +    - ["JongChan Choi", "http://0xABCDEF.com/"] +lang: ko-kr +--- + +Brainfuck(f는 대문자로 적지 않습니다)은 +여덟가지 명령어만으로 튜링-완전한 최소주의 프로그래밍 언어입니다. + +``` +"><+-.,[]" 이외의 문자들은 무시됩니다. (쌍따옴표는 제외) + +브레인퍽은 30,000 칸 짜리의 0으로 초기화된 배열과, +현재 칸을 가르키는 포인터로 표현됩니다. + +여덟가지의 명령어는 다음과 같습니다: ++ : 포인터가 가르키는 현재 칸의 값을 1 증가시킵니다. +- : 포인터가 가르키는 현재 칸의 값을 1 감소시킵니다. +> : 포인터가 다음 칸(오른쪽 칸)을 가르키도록 이동시킵니다. +< : 포인터가 이전 칸(왼쪽 칸)을 가르키도록 이동시킵니다. +. : 현재 칸의 값을 ASCII 문자로 출력합니다. (즉, 65 = 'A') +, : 하나의 문자를 입력받고 그 값을 현재 칸에 대입합니다. +[ : 현재 칸의 값이 0이면 짝이 맞는 ] 명령으로 넘어갑니다. +    0이 아니면 다음 명령어로 넘어갑니다. +] : 현재 칸의 값이 0이면 다음 명령어로 넘어갑니다. +    0이 아니면 짝이 맞는 [ 명령으로 다시 돌아갑니다. + +[이랑 ]은 while 루프를 만들어냅니다. 무조건, 짝이 맞아야 합니다. + +몇가지 간단한 브레인퍽 프로그램을 보겠습니다. + +++++++ [ > ++++++++++ < - ] > +++++ . + +이 프로그램은 문자 'A'를 출력합니다. 처음에는, 반복할 횟수를 정하기 위한 값을 +만들기 위해 첫번째 칸의 값을 6으로 증가시킵니다. 그리고 루프로 들어가서([) +두번째 칸으로 넘어갑니다. 루프 안에서는 두번째 칸의 값을 10 증가시키고, +다시 첫번째 칸으로 넘어가서 값을 1 감소시킵니다. 이 루프는 여섯번 돕니다. +(첫번째 칸의 값을 6번 감소시켜서 0이 될 때 까지는 ] 명령을 만날 때마다 +루프의 시작 지점으로 돌아갑니다) + +이 시점에서, 두번째 칸의 값은 60이고, 포인터는 값이 0인 첫번째 칸에 위치합니다. +여기서 두번째 칸으로 넘어간 다음 값을 5 증가시키면 두번째 칸의 값이 65가 되고, +65는 문자 'A'에 대응하는 아스키 코드이기 때문에, 두번째 칸의 값을 출력하면 +터미널에 'A'가 출력됩니다. + +, [ > + < - ] > . + +이 프로그램은 사용자로부터 문자 하나를 입력받아 첫번째 칸에 집어넣습니다. +그리고 루프에 들어가서, 두번째 칸으로 넘어가 값을 한 번 증가시킨 다음, +다시 첫번째 칸으로 넘어가서 값을 한 번 감소시킵니다. +이는 첫번째 칸의 값이 0이 될 때까지 지속되며, +두번째 칸은 첫번째 칸이 갖고있던 값을 가지게 됩니다. +루프가 종료되면 포인터는 첫번째 칸을 가르키기 때문에 두번째 칸으로 넘어가고, +해당 아스키 코드에 대응하는 문자를 출력합니다. + +또한 공백문자는 순전히 가독성을 위해서 작성되었다는 것을 기억하세요. +다음과 같이 작성해도 똑같이 돌아갑니다: + +,[>+<-]>. + +한 번 돌려보고 아래의 프로그램이 실제로 무슨 일을 하는지 맞춰보세요: + +,>,< [ > [ >+ >+ << -] >> [- << + >>] <<< -] >> + +이 프로그램은 두 개의 숫자를 입력받은 뒤, 그 둘을 곱합니다. + +위 코드는 일단 두 번의 입력을 받고, 첫번째 칸의 값만큼 바깥 루프를 돕니다. +그리고 루프 안에서 다시 두번째 칸의 값만큼 안쪽의 루프를 돕니다. +그리고 그 루프에서는 세번째 칸의 값을 증가시키는데, 문제가 하나 있습니다: +내부 루프가 한 번 끝나게 되면 두번째 칸의 값은 0이 됩니다. +그럼 다시 바깥 루프를 돌 때에 안쪽의 루프를 돌지 않게 되는데, 이를 해결하려면 +네번째 칸의 값도 같이 증가시킨 다음, 그 값을 두번째 칸으로 옮기면 됩니다. +그러면 세번째 칸에 곱셈의 결과가 남습니다. +``` + +여기까지 브레인퍽이었습니다. 참 쉽죠? +재미삼아 브레인퍽 프로그램이나 다른 언어로 브레인퍽 인터프리터를 작성해보세요. +인터프리터 구현은 간단한 편인데, +사서 고생하는 것을 즐기는 편이라면 한 번 작성해보세요… 브레인퍽으로. diff --git a/pogo.html.markdown b/pogo.html.markdown new file mode 100644 index 00000000..60a83edd --- /dev/null +++ b/pogo.html.markdown @@ -0,0 +1,202 @@ +--- +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/), inlcuding 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! diff --git a/tr-tr/brainfuck-tr.html.markdown b/tr-tr/brainfuck-tr.html.markdown index a6f6f078..baca4217 100644 --- a/tr-tr/brainfuck-tr.html.markdown +++ b/tr-tr/brainfuck-tr.html.markdown @@ -8,44 +8,45 @@ translators:  lang: tr-tr  --- -Brainfuck son derece minimal bir programlama dilidir. (Sadece 8 komut) ve  -tamamen Turing'dir. +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.  ``` -"><+-.,[]" (tırnak işaretleri hariç) karakterleri dışındaki her karakter  +"><+-.,[]" (tırnak işaretleri hariç) karakterleri dışındaki her karakter  gözardı edilir. -Brainfuck is represented by an array with 30,000 cells initialized to zero -and a data pointer pointing at the current cell. +Brainfuck 30,000 hücresi olan ve ilk değerleri sıfır olarak atanmış bir +dizidir. İşaretçi ilk hücreyi işaret eder. -There are eight commands: +Sekik komut vardır:  + : Geçerli hücrenin değerini bir artırır.  - : Geçerli hücrenin değerini bir azaltır.  > : Veri işaretçisini bir sonraki hücreye hareket ettirir(sağdaki hücreye).  < : Veri işaretçisini bir önceki hücreye hareket ettirir(soldaki hücreye).  . : Geçerli hücrenin ASCII değerini yazdırır (örn: 65 = 'A').  , : Bir girdilik karakteri aktif hücre için okur. -[ : Eğer geçerli hücredeki değer sıfır ise, ]ifadesine atlar.  +[ : Eğer geçerli hücredeki değer sıfır ise, ]ifadesine atlar.      Diğer durumlarda bir sonraki yönergeye geçer. -] : Eğer geçerli hücredeki değer sıfır ise, bir sonraki yönergeye geçer.  +] : Eğer geçerli hücredeki değer sıfır ise, bir sonraki yönergeye geçer.      Diğer durumlarda, [ ifadesine karşılık gelen yönergelere döner.  [ ve ] bir while döngüsü oluşturur. Açıkça, dengeli olmalıdırlar. -Basit bir Brainfuck programına göz atalım.  +Basit bir brainfuck programına göz atalım.  ++++++ [ > ++++++++++ < - ] > +++++ .  Bu program 'A' karaterini ekrana basar. İlk olarak, #1'inci hücre 6'ya artırılır. -#1'inci hücre döngü için kullanılacaktır. Sonra, ([) döngüsüne girilir ve  -#2'inci hücreye hareket edilir. #2'inci hücre 10 kez artırılır, #1'inci hücreye  -geri dönülür. #1 hücresini bir azaltır. Bu döngü 6 kez gerçekleşir. (Bu 6 kez  +#1'inci hücre döngü için kullanılacaktır. Sonra, ([) döngüsüne girilir ve +#2'inci hücreye hareket edilir. #2'inci hücre 10 kez artırılır, #1'inci hücreye +geri dönülür. #1 hücresini bir azaltır. Bu döngü 6 kez gerçekleşir. (Bu 6 kez  azaltmak demektir, #1 hücresi 0 değerini alır ve bu noktada ] ifadesini atlar). -Bu noktada, biz #1 hücresindeyiz, değeri şu anda 0 ve #2 hücresinin değeri  +Bu noktada, biz #1 hücresindeyiz, değeri şu anda 0 ve #2 hücresinin değeri  60'tır. Biz #2 hücresine hareket diyoruz ve bu hücreyi 5 defa artırıyoruz. -#2'nin şu anki değeri 65 olur. Sonra #2 hücresinin ASCII karşılığını  -yazdırıyoruz. 65 değerinin ASCII karşılığı 'A'dır. Ekrana 'A' yazılacaktır.  +#2'nin şu anki değeri 65 olur. Sonra #2 hücresinin ASCII karşılığını +yazdırıyoruz. 65 değerinin ASCII karşılığı 'A'dır. Ekrana 'A' yazılacaktır.  , [ > + < - ] > . @@ -53,14 +54,14 @@ yazdırıyoruz. 65 değerinin ASCII karşılığı 'A'dır. Ekrana 'A' yazılaca  Bu program kullanıcıdan bir girdi okur, ve karakteri bir diğer hücreye yazdırır,  ve daha sonra aynı karakteri ekrana yazdırır. -, ifadesi kullanıcıdan karakteri #1 hücresine okur. Sonra bir döngü  -başlar. #2 hücresine hareket edilir, #2 hücresinin değeri bir artırılır, #1  +, ifadesi kullanıcıdan karakteri #1 hücresine okur. Sonra bir döngü +başlar. #2 hücresine hareket edilir, #2 hücresinin değeri bir artırılır, #1  hücresine geri dönülür, ve #1 hücresinin değer bir azaltılır. Bu #1 hücresinin -değeri 0 olana kadar devam eder ve #2 hücresi #1'in eski değerini tutar. Çünkü  +değeri 0 olana kadar devam eder ve #2 hücresi #1'in eski değerini tutar. Çünkü  biz #1 hücresindeki verileri döngü süresince #2 hücresine taşıyoruz, ve sonunda  #2 hücresinin ASCII değerini yazdırıyoruz. -Boşluk karakteri sadece okunabilirliği artırmak içindir. Aşağıdaki gibi de  +Boşluk karakteri sadece okunabilirliği artırmak içindir. Aşağıdaki gibi de  yazabilirsiniz.  ,[>+<-]>. @@ -68,19 +69,19 @@ yazabilirsiniz.  Bu uygulamanın ne yaptığına bakalım: -,>,< [ > [ >+ >+ << -] >> [- << + >>] <<< -] >>   +,>,< [ > [ >+ >+ << -] >> [- << + >>] <<< -] >>  Bu program 2 sayı alır, ve birbiri ile çarpar. -Özetle, ilk olarak iki girdi alır. Sonra, #1 hücresinde şarta bağlı harici bir  +Özetle, ilk olarak iki girdi alır. Sonra, #1 hücresinde şarta bağlı harici bir  döngü başlar. Sonra #2 ye hareket edilir, ve içerde #2 hücresine bağlı bir döngü -daha başlar ve #3 hücresinin değerini artırır. Ama, Bir problem vardır: iç  -döngünün sonunda #2'inci hücrenin değeri 0 olacaktır. Bunu çözmek için #4  -hücresinin de değerini yükseltiyoruz, ve sonra #4 hücresinin değerini #2'ye  +daha başlar ve #3 hücresinin değerini artırır. Ama, Bir problem vardır: iç +döngünün sonunda #2'inci hücrenin değeri 0 olacaktır. Bunu çözmek için #4 +hücresinin de değerini yükseltiyoruz, ve sonra #4 hücresinin değerini #2'ye  kopyalıyoruz.  ``` -İşte Brainfuck. Zor değil değil mi? Eğlenmek için kendi programınızı  -yazabilirsiniz, veya farklı bir dilde Brainfuck yorumlayıcısı yazabilirsiniz. -Yorumlayıcı oldukça basittir, ama mazoşist iseniz, Brainfuck içerisinde bir  -Brainfuck yorumlayıcısı yazmayı deneyebilirsiniz. +İşte brainfuck. Zor değil değil mi? Eğlenmek için kendi programınızı +yazabilirsiniz, veya farklı bir dilde brainfuck yorumlayıcısı yazabilirsiniz. +Yorumlayıcı oldukça basittir, ama mazoşist iseniz, brainfuck içerisinde bir +brainfuck yorumlayıcısı yazmayı deneyebilirsiniz. | 
