ਬ੍ਰੇਨਫ਼ੱਕ

ਵਿਕੀਪੀਡੀਆ, ਇੱਕ ਅਜ਼ਾਦ ਗਿਆਨਕੋਸ਼ ਤੋਂ
ਬ੍ਰੇਨਫ਼ੱਕ
ਪੈਰਾਡਾਈਮesoteric, imperative, structured
ਡਿਜ਼ਾਇਨ-ਕਰਤਾUrban Müller
ਸਾਹਮਣੇ ਆਈ1993
typeless
.b, .bf

ਬ੍ਰੇਨਫ਼ੱਕ (ਅੰਗਰੇਜ਼ੀ: Brainfuck) ਇੱਕ ਇਸੋਟੀਰਿਕ ਪ੍ਰੋਗਰਾਮਿੰਗ ਭਾਸ਼ਾ ਹੈ ਜੋ 1993 ਵਿੱਚ ਅਰਬਨ ਮੂਲਰ ਦੁਆਰਾ ਬਣਾਈ ਗਈ ਸੀ। ਇਸ ਭਾਸ਼ਾ ਵਿਚ ਸਿਰਫ ਅੱਠ ਸਧਾਰਨ ਹੁਕਮ ਅਤੇ ਇੱਕ ਹਦਾਇਤ ਸੰਕੇਤਕ ਹੈ। ਜਦਕਿ ਇਹ ਭਾਸ਼ਾ ਪੂਰੀ ਟਿਉਰਿੰਗ-ਪੂਰਨ ਹੈ, ਇਹ ਅਮਲੀ ਵਰਤਣ ਲਈ ਨਹੀਂ ਪਰ ਪ੍ਰੋਗਰਾਮਰ ਨੂੰ ਚੁਣੌਤੀ ਅਤੇ ਮਨੋਰੰਜਨ ਦੇਣ ਲਈ ਬਣਾਈ ਗਈ ਹੈ।

ਹੁਕਮ[ਸੋਧੋ]

ਇਸ ਭਾਸ਼ਾ ਦੇ ਅੱਠ ਹੁਕਮ ਸਾਰੇ ਇੱਕ ਅੱਖਰ ਦੇ ਹਨ:

ਅੱਖਰ ਅਰਥ
> increment the data pointer (to point to the next cell to the right).
< decrement the data pointer (to point to the next cell to the left).
+ increment (increase by one) the byte at the data pointer.
- decrement (decrease by one) the byte at the data pointer.
. output the byte at the data pointer.
, accept one byte of input, storing its value in the byte at the data pointer.
[ if the byte at the data pointer is zero, then instead of moving the instruction pointer forward to the next command, jump it forward to the command after the matching ] command.
] if the byte at the data pointer is nonzero, then instead of moving the instruction pointer forward to the next command, jump it back to the command after the matching [ command.

ਬ੍ਰੇਨਫ਼ੱਕ ਪ੍ਰੋਗਰਾਮ ਦਾ ਸੀ ਵਿੱਚ ਅਨੁਵਾਦ ਕੀਤਾ ਜਾ ਸਕਦਾ ਹੈ:

ਬ੍ਰੇਨਫ਼ੱਕ ਹੁਕਮ  ਸੀ ਬਰਾਬਰ
(ਪ੍ਰੋਗਰਾਮ ਸ਼ੁਰੂਆਤ) char array[infinitely large size] = {0};

char *ptr=array;

> ++ptr;
< --ptr;
+ ++*ptr;
- --*ptr;
. putchar(*ptr);
, *ptr=getchar();
[ while (*ptr) {
] }

ਇਹ ਵੀ ਵੇਖੋ[ਸੋਧੋ]

  • JSFuck – ਇੱਕ ਇਸੋਟੀਰਿਕ ਜਾਵਾ ਪ੍ਰੋਗਰਾਮਿੰਗ ਭਾਸ਼ਾ

ਹਵਾਲੇ[ਸੋਧੋ]

ਬਾਹਰੀ ਕੜੀਆਂ[ਸੋਧੋ]