Thread is for math problems as title say it "Math Problems". So I got this problem:
What I have done already is this:
char unsigned strASCIITable[256];
if(strASCIITable[cOverflow])
{
if(cPosision!=cOverflow)
{
if(cPosision>cOverflow) for (;cPosision>cOverflow; --cPosision) fprintf(fpOutput, "<");
else for(;cPosision<cOverflow; ++cPosision) fprintf(fpOutput, ">");
}
}
Now if you don't understand C, don't freak out! I will explain everything in time. You see the problem in human language is that I want to do the most optimized way of displaying brainfuck. It works like this:
===Brainfuck===
Background:This is a to low powerful programing languages inspired by Turing, a bad person if you ask me.
How it works:
The brainfuck language is written as a western style one step in a time command language. E.G: [command][command][command][command][command][command][command][command][command] (You do understand that a command is to do some thing; did you know that there are only 7 commands in brainfuck, as compared to most other languages that have ~27 in these days?)
Think that you have 3000 empty boxes in a line from 1 to 3000.
To move to the box right of you, use this command:>
To move to the box left of you, use this command:<
Every box can have a number from 0 to 255(or higher, I really don't know if higher value.)
To make the box you are in higher, use this command:+
To make the box you are in lower, use this command:-
==Advance topic:==
There are in brainfuck loops. These loops are called in C "do while loops" to best comparison.
To mark out the beginning of the loop do this command:[ (This command will not do anything, it just survey as a label to where the loop start)
To make the end of the loop, use this command:] (it will check the box on the position it is on, if that value is 0 it will stop else it will go back to the first [ "lable" left of the command line)
==I/O==
To get input, use this command:, (you need now to press a key that will be stored in the box position it is in as a ASCII value)
To display input, use this command:. (it will display the value in the "box" where you position is as a ASCII character to output)
<ENTER>
<ENTER>
<ENTER>
<ENTER>
<ENTER>
<ENTER>
Now the problem is, what is the most optimized way to convert some ASCII art to brainfuck code that display it. From my knowledge there are to steps one need to take:
-OP (Anon)
You seem smart. Can you help me with this? I'm trying to figure out MutationObservers in Javascript. I have them working in Chrome, but they don't behave the same way in Firefox for some reason. Say I have a page like this:
<div>
<div>
<div class="asdf"></div>
<div class="asdf"></div>
<div class="asdf"></div>
<div class="asdf"></div>
<div class="asdf">
<div class="dsfa"></div>
</div>
</div>
</div>
In Chrome, if I ran
var observer = new MutationObserver(function (mutations) {
mutations.forEach(function (mutation) {
if (mutation.addedNodes) {
for (var i = 0; i < mutation.addedNodes.length; i++) {
var node = mutation.addedNodes[i];
if(node.className) {
console.log(node);
}
}
}
});
});
observer.observe(document, {
childList: true,
subtree: true
});
...I'd get all of the divs with class names printed in the console. In Firefox, they are ignored. Why is Firefox not detecting them?
>>2
This is not a mathematical question(this statement can be wrong).
I will provide with a answer but I need to do research that will take more time. If you want to have a fast answer do one of these two options:
http://caniuse.com/mutationobserver
2. Download this https://www.google.com/intl/en/chrome/browser/ after installing this application change the file chrome (any file with .exe) to the name firefox.
I am sorry for my lack of support.
acctatcwfvagkxryawebgckuacrgbxkuxagwkxawg
awgyubgrcyukabgeukgyaweyuawgjuywecykuujy
gyugjyrabgjyuagukawerfgvkaxryxrkayefkex
awyjawxjbafgjcrbakwyfrawyjrawfbjryjrwe
aryjwfvyawerjfveyjafveryjfayjfweryfva
awertvjawfvryjafxraxrajtfravjweyxfvr
aywfvawryfvjawyfyjrfxawaxwxrawxrrxr
awetyrvftajxfvrawetefjawefzajtfjaw
rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
wertywfhvayfweafawrhzfvwjafvxzwf
yawef yywetfabyjweftejawfbdjted
wetfvtwjvwedyjdfjawetftydfvtjw
weftyfvwejyfdvwyj ftyfweydfwe
wetyfwjaevytyfqwtefvfqwjtfqj
qweqwetfyqwefvyqwefvyqgqebu
qtywefvyqwfqweyfvqweytfqwe
qwytfvqwtyfhctqfvtfeqtyqw
qwtyfvqweqwetyfvtvqwe fq
qwtyvfqweyvfqweytfqwtyf
qqqqqqqqqqqfffffffffff
qweftyfvqweyfvwqeyqwe
setvfseyysxefysefysy
seryuvusegusye futf
wtyefywefvaqtyqfvw
qtyvfqweytfvqweyf
esfygwe ufweytfw
ywegyuwefytwefq
qwetyfqweyywvq
qwetyqwefvytq
qwtyzqwtyeez
qfwtyfvqewx
qwgvqweuge
qwetyqweq
wuecvywe
wefywee
weryzw
wetfv
weyz
tfw
er
q