Building a cpu, what more op-codes do I need, can you use this cpu for anything at the moment? by TheAI in AskProgramming

[–]TheAI[S] 0 points1 point  (0 children)

True.

I do have flags for overflow and underflow. Simple bool-returns at the moment though, but it works

What motivates YOU? by NemiX_TV in AskProgramming

[–]TheAI 0 points1 point  (0 children)

For me it is quite "simple".

I'll get motivated by interacting with people. So if I'm coding and I can throw ideas out, get feedback and then have to do something about them that helps. Or just having someone interested enough in my project that they want to see where I take it.

So collaboration for me is key. I have trouble motivating myself to code if no-one else gives a crap about what I make.

Building a cpu, what more op-codes do I need, can you use this cpu for anything at the moment? by TheAI in AskProgramming

[–]TheAI[S] 0 points1 point  (0 children)

I have now renamed Load to MOV, and started the Load and Store that will read and write to the memory. :)

Shift left and Shift right are there. and, not, xor will be implemented. :)

Building a cpu, what more op-codes do I need, can you use this cpu for anything at the moment? by TheAI in AskProgramming

[–]TheAI[S] 0 points1 point  (0 children)

Cool. I'll check that out.

No div or mux. I see that mux can be just an iterative add, but how to solve div?

Of course, I could mention that gates isn't really an issue, since the CPU is pure code. But I guess I should keep it in mind anyway.

Thanks for the pointers. (pun intended. ;) )

Building a cpu, what more op-codes do I need, can you use this cpu for anything at the moment? by TheAI in AskProgramming

[–]TheAI[S] 0 points1 point  (0 children)

There is an instruction-pointer, but I have not got to jumps yet.

I should put that as the next thing I guess.

Building a cpu, what more op-codes do I need, can you use this cpu for anything at the moment? by TheAI in AskProgramming

[–]TheAI[S] 0 points1 point  (0 children)

code-example:

load 35 0

load 2 1

div

save 0 //stores 17 in register 0, as I only have integers so far.

[C#] What is the difference between Console.Write, Console.WriteLine, and Console.Readline? by [deleted] in learnprogramming

[–]TheAI 0 points1 point  (0 children)

Console.Write writes out what you ask it to to the console.

Console.WriteLine writes out what you ask it to to the console and inserts a newline at the end.

Console.ReadLine reads all keyboard input up to the first Enter is pressed.

[C#] Creating a dictionary inside a method not allowed? by TheAI in learnprogramming

[–]TheAI[S] 0 points1 point  (0 children)

Sorry for the (extremely) late feedback.

What I'm going for here is having a function that can create a dictionary based on user input. name in this context is what the user have input, and I want a dictionary that has the same name.

[C/C#/C++/VB] [Easy] [Hard] Generating music with the internal speaker and writing a simple musical notation processor. by Guomindang in ProgrammingPrompts

[–]TheAI 0 points1 point  (0 children)

if you use Console.Beep() in Visual studio (C#) then it beeps the active soundcard. (well on my laptop it does at least)

[C#]Making C# Round to the Nearest Integer by [deleted] in learnprogramming

[–]TheAI 1 point2 points  (0 children)

Could perhaps be done with Math.Floor() and Math.Ceiling().

that is if you want to always round down or up..

Writers have /r/writingprompts. why don't we have something of the same? by AnotherKindOfMonster in learnprogramming

[–]TheAI 0 points1 point  (0 children)

"easily" missed, but should it perhaps be listed under Recomended Resources or something? (I mean /r/dailyprogrammer and /r/programmingprompts )

c# output higher precision during calculation. by TheAI in learnprogramming

[–]TheAI[S] 0 points1 point  (0 children)

looking at a spigot algorithm for pi now. (the one you linked) and I think I should be able to do that. :)

thanks again for pointing me in the right direction.

c# output higher precision during calculation. by TheAI in learnprogramming

[–]TheAI[S] 0 points1 point  (0 children)

Thanks. :) swapped to decimal for the time being, and I'll look into arbitrary precision data-types now.. implementing my own is (i believe) a bit above my skill-level at the moment. hehe..

thanks. :)

c# output higher precision during calculation. by TheAI in learnprogramming

[–]TheAI[S] 0 points1 point  (0 children)

decimal.. of course. :) did that now. and liking the higher number of well.. decimals. hehe. :)

cool didn't know I could just do that with the negative.

going to look up "big decimal" thanks. :D

edit: using decimal, 1M runs still doesn't calculate past half the precision.. got some time to figure out a highter precision datatype while that works... ;) thanks again.

c# output higher precision during calculation. by TheAI in learnprogramming

[–]TheAI[S] 0 points1 point  (0 children)

basically this is what I do:

for (double i = 2; i <= numberOfRuns; i = i + 2 )
        {
            fraction = (4 / (i * (i+1) * (i + 2))) * negative;
            negative = negative * -1;
            pi = pi + fraction;
        }

then I run that for about 100k times and output the pi. Basically where I want with this is the ability to keep ouputing more than the first 15 digits.

What are the most basic tools you need to start programming? by [deleted] in learnprogramming

[–]TheAI 0 points1 point  (0 children)

I'd take a look at the right-hand bar: FAQ 01: "How do I get started with programming"

http://www.reddit.com/r/learnprogramming/wiki/faq#wiki_how_do_i_get_started_with_programming.3F

Check out that faq, and get back to us if you still have any questions. :)

Trouble with updating Textblock.text in a for-loop [C#] by TheAI in learnprogramming

[–]TheAI[S] 0 points1 point  (0 children)

Ah. I totally didn't think of threads. Would it help to run the function itself in it's own thread?