• 0

    posted a message on $100 budget: which programming books should I get?
    Hello!

    I recently got bronze in the South African Computer Olympiad, and won R2 000 that I could spend on anything (I'll be getting a 3D printer, specifically the printrbot makers kit, but that's not important) and an additional R1 000, or about $100, to spend on books about programming and/or algorithms.



    The problem is, i don't know what books I should get. There's a whole lot of resources out there about good computer science books, but the problem is I'm not in university yet, and I don't know university level maths. The one book I do have is "The fundamentals of data structures in C++" which I got from a friend, but not only does it go WAAY beyond fundamentals, but it starts using weird math symbols and terms that I'm not familiar with, and I just get lost. I'm wondering if such books even exist without being too basic that I can't learn anything new from them.

    So here's some perhaps useful info:

    • I'm self taught, so I know how to do some things but I don't know their real technical names
    • I know Java reasonably well, but I would love to learn proper C++. I've coded quite a bit in C for Arduino boards, though.
    • I don't understand university level maths, and while I would love to learn some along the way, I don't want to have to buy a book on calculus just so I can understand a book on programming
    And here's what I would like a book about:

    • Some C++ tutorial that also goes over the C++ equivalent of Java's Java2D and Swing, and if possible for both Windows and Linux.
    • Something about learning how to make or use algorithms in Java or C++. By using algorithms I mean already known ones like D* pathfinding, and designing your own with techniques like dynamic programming.
    • Making code more efficient. Binary search trees, hash maps, etc. and ways to avoid "brute force" solutions.
    So yes, any recommendations? I know this is a lot to ask, and a strange place to ask it, but It's the most active forum I know other than Stackoverflow, and I wasn't sure if this was a question appropriate for Stackoverflow.
    Posted in: Computer Science and Technology
  • 0

    posted a message on The Computer Thread
    Thanks for the ideas. Do those computers use command blocks? Can I use that format?

    The first one doesn't, the second and third ones do. It's not too hard to click on the links and find out yourself, you know.
    And yes, you can use that format, I suggested it so you could perhaps use it (or for you to base your format off of).
    Posted in: Redstone Creations
  • 0

    posted a message on The Computer Thread
    Yes, I'd say merge this thread and the other on computer parts, perhaps split it only when this thread has too many computer parts or computers to keep them together. You know, a long time ago there was a reasonably well maintained list of redstone computers. It had a neat format and a little summary about the speed and overall specs of the computer.

    Anyway, if you want to start a thread like this, I'd recommend you at least do some research on current computers.

    Ones that I can think of on the top of my head include this one and this one, though both are still under construction. For one that's finished, there is of course my commandore 32. I don't know any more right now (may have forgotten one), but you should go find some yourself.

    The first two are only really relevant if you want to include WIP machines, of course. If you want to include "fake" computers like the iPods and PC systems with keyboards and mice, then there's a ton of those on the forum too.



    Posting a consistent spec format for all computers is a challenge though, as more and more computers are moving to custom architectures and dynamic clocks, making clock speed and CPU family hard to determine. I'd suggest a format like this:

    • Name:
    • Creator:
    • Release date:
    • Computer class: (redstone, command block, WIP or "fake")
    • key features list: (best features making this computer unique, e.g. multithread support, microinstructions etc.)
    Or something like that, anyway.
    Posted in: Redstone Creations
  • 0

    posted a message on Commandore 32: Advanced command block based computer. Programming tutorial now available!
    Quote from eah2119»

    I dunno what it was, but I tried it a second time and it worked.

    Writing programs for this computer reminds me of how lucky we are to have 3 GHz processors. The average programmer doesn't need to know what's going on behind the scenes. Any lousy programmatically generated machine code is mitigated by the lightning fast computer. On the other hand, writing for the commandore 32, you might actually need to think about general purpose registers and other machine code level optimizations as it could be the difference between 20 minutes and 3 minutes of execution time.

    I'm thinking of making a checkers game. The display is just the right size for it and with arrays, seems like a good project. However, turning the board around for a second player is out of the question (unless one wanted to play checkers upside down or if there was another display buffer ^_^). It would need an AI, albeit a very primitive one. Artificial chess and checkers opponents normally go through a tree of possible moves, picking out the best branch, but we don't have the speed for that.

    I wouldn't mind playing upside down as the opponent. A little disorienting, but a small price to pay to get to play checkers on a Minecraft computer.

    Also, remember the GPU has collision detection! It seems a lot of people forget about this feature (perhaps it's too complicated) but it could be very useful for something like checkers.

    I *might* add yet another framebuffer in the future (someday...) that could be used for this purpose.

    As for why your program didn't work, it could be an upload failure. With large programs especially, it helps to upload the same program multiple times.
    Posted in: Redstone Creations
  • 0

    posted a message on Commandore 32: Advanced command block based computer. Programming tutorial now available!
    Hi all, sorry that I haven't updated this much, but here's some new stuff:

    Firstly, I'm updating the user made programs list to include Pong and Artist. I wanted to add the fast Fibonacci program, but I couldn't find it anymore.

    For the Text drawer program, I've generated a list of English words that can be drawn using the 9 available letters, in alphabetical order: http://pastebin.com/5sZRvyFD this should help make that program more useful. It even includes the corresponding number needed to write the word in the program, for your convenience.

    And lastly, episode 6 of the tutorial is FINALLY out, demonstrating the basic GPU commands!

    Posted in: Redstone Creations
  • 0

    posted a message on Commandore 32: Advanced command block based computer. Programming tutorial now available!
    Quote from eah2119»
    So, arrays seem to act weird, and I don't know what it is about them. Maybe some of the arguments aren't being treated as I expect them to, such as passing a variable's address rather than the value at its address.

    I expect this program to print 5, but it prints 0. Is it a problem with my understanding or something else?

    [code]

    Strange. I tried it and it works fine for me, printed out 5 like it should. Is it an uploading problem? Perhaps I changed some timing in my version that I forgot about. Can anyone else confirm this?
    Posted in: Redstone Creations
  • 0

    posted a message on Commandore 32: Advanced command block based computer. Programming tutorial now available!
    Quote from mmdanggg2»
    I did a video on this, here:

    You... I Remember you! From way back in the glory days of the Redgame 1! It's been pretty long. You should do videos of my computers more often. I mean, you get ad revenue from it, so it's a win win :D (as long as you link to this forum post and mention me in the description like you did, it's fine)

    Anyway, you mentioned that this is slower than the RG1. It's actually much faster, but because you're making a much more advanced program in a high level language with a terrible optimization engine, it seems slower. But compare your old Fibonacci program for the RG1 to the high speed Fibonacci program someone posted on this forum somewhere (I should find that post) (and not the one included in the download, which is kinda intentionally slow), you'll see the HUGE difference in speed. If you want, I could try optimize your pong program for you. There's a lot that can be done, like using register manipulation, removing uneeded methods and writing them inline, and taking advantage of ALU 2.
    Finally, if you want to explore while pressing a button on the D-pad, you can throw an item on it. It'll stay pressed for 5 minutes. :D

    The command block debug output was pretty interesting though, I've never turned that on again after turning it off at the very beginning of the build.
    Quote from c4ooo_redstone»
    Can you say how dast your computer can repeatingly disply a number that is stored in ROM? by display i mean in the chat. If to display a value in ROM you nead to copy it to a refister do that every loop. Thanks ime just want to compare :)

    Also how long does it take to fetch an instruction?

    You can just write a simple program yourself, you know. Here's all it takes:
    function main:
    {
    print(1);
    print(2);
    print(3);
    }

    or if you want to print the same number infinitely:
    function main:
    {
    while(true)
    {
    print(12);
    }
    }

    Use a stopwatch app on your phone or something. I don't know which one you want and the second one would be slower. In terms of instructions, since printing a static number is kinda useless, it's a 2 instruction process. The compiler will store the value to the TEMP register using STO, and then print out the TEMP register.

    As for instruction loading time... You can kind of think of it as nonexistent. This computer is pipelined, so it loads the next instruction WHILE the current one is running. It does need to wait for the instruction to load when branching is involved (it has no branch prediction whatsoever, even an obviously infinite loop like while(true) is assumed false). Some very fast instructions wait a little for the loading to finish before continuing, but for most the loading is done before it's finished doing its thing.
    Posted in: Redstone Creations
  • 0

    posted a message on Commandore 32: Advanced command block based computer. Programming tutorial now available!
    Quote from mmdanggg2»
    Hey, awesome work as always. I made a quick and crappy pong: http://pastebin.com/SpUwhCKJ

    First, a problem with the compiler. If I try to set a variable to a negative number it doesn't like have a space between the equals and the number, eg.

    var = 1; //works
    var = -1; // doesn't work
    var=-1; // works
    I also can't return a negative number eg.
    return -1; // doesn't work
    negOne=-1;
    return negOne; //workaround

    Second, its just too slow to really be usable. It needs to go super sanic speed.

    That pong thing is super awesome! Mind if I added it to the user created programs list?

    As for the negative number issues...yea. That's kinda because of how my tokeniser works. You might think it's simple, but telling the difference between subtracting 2 numbers and a negative number is pretty difficult. I'll see if I can find a workaround, but it won't be pretty, if I can even find one. The whole tokeniser is flawed on that aspect.

    As for speed, this was my first command block computer, and the first "real" command block computer in minecraft (aside from a very simple but still cool brainfu*k one I found). Speed was not the focus, making it easy to program was. I'm not good with speedy designs, they get crazy hard to debug.

    Still, this is fast to normal redstone computer standards. Your pong program can be a lot faster by using more low level stuff when you're ready for it. Using the second ALU, removing functions for speed, working with registers etc.
    Quote from Spoyodude179»

    I know that, but what I need is the most efficient program layout for that design. How should I layout the program command blocks. should I have it as grid: 1 2 3
    d d d
    d d d
    In this case it it a 3 line 2 instruction program, but is there a more efficient way?

    Depends on your instruction set! if you have a 3 value instruction set like the commandore 32, then that, but if you have a 5 value or a 2 value system, then increase the width accordingly!
    Besides, you shouldn't worry about efficiency in your first attempt; it should just work. Once you know it's working, you can find what's wrong with it and what can be improved and make a better one. Get it working first, perfect it later! If you look at my older commandore 32 videos during construction, you'll see many parts were much bigger originally than they are now, as I rebuilt them when I found they were working. The ROM alone got 3 complete redesigns during construction alone (twice during planning, or rather, 2 scrapped early potential ideas).
    Quote from eah2119»
    Can anyone glance at this program and see something wrong with it?

    http://pastebin.com/nbbAZ3jv

    Look at the print statements I've added for debugging. I expect it to output 0, 11, etc., but it repeatedly outputs 0. The sample programs work fine and I've tried using a fresh world with no luck. It could be a compiler bug, but I'm not too keen on reading assembly yet.

    And when I said I got it working on mac, that was a lie. I only tried it with a text editor and incorrectly assumed it works with minecraft. Turns out minecraft won't respond to FK_META event though other programs recognize it as the command key. As a workaround, I used some methods you wrote and didn't use. It works now by typing the commands letter by letter. Still just as fast as pasting.

    A turing machine? That's really awesome! But will also be a nightmare to debug :D
    It only prints out 0's during the array initialization. After that it does this:

    Note that the other stuff was me trying to debug your program, no sucess so far! Arrays haven't been tested thoroughly though, so it may be a system issue. I'll see if I can get it working later.

    As for the mac thing: darnit! I just deleted that code to clean up the program a little. Now I have to put the code back from an older version. Does Minecraft for Mac just no longer support paste at all?
    Posted in: Redstone Creations
  • 0

    posted a message on Commandore 32: Advanced command block based computer. Programming tutorial now available!
    Quote from Spoyodude179»

    Enter an instruction in the commmandblock to program it.

    On the GPU, I use a normal select xy, and color system, but also have a select layer system. EX: pretend letter h is a pixel

    2D: Hx4deep
    Hx4deep
    H x4deep
    Hx4deep View box
    3D: 1 2 3 4
    Hx4deep Hx4deep Hx4deep Hx4deep
    Hx4deep Hx4deep Hx4deep Hx4deep
    Hx4deep Hx4deep Hx4deep Hx4deep


    Hope that makes sense.

    I got the layer explanation, but your diagram is confusing. I think I get it though. Cool!

    Anyway, you seem to be attempting a lookup table for your instruction set, right? sort of like:
    if it's "add", set torches to pattern A
    if it's "subtract", set torches to pattern B
    etc.
    Which is pretty much exactly what I did with the Commandore 32's ROM system. There's basically an entire row of command blocks which are updated, but instead of checking a command block they check a scoreboard (specifically, player romAddr of scoreboard system) and their comparator output leads to a buffer area, which is activated after a few ticks by filling it with stone so it can conduct power to command blocks next to it, which in your case would copy the pattern.
    Posted in: Redstone Creations
  • 1

    posted a message on Commandore 32: Advanced command block based computer. Programming tutorial now available!
    Quote from eah2119»
    Well, it's not the windows key as I thought. The command key is actually KeyEvent.VK_META or key code 157.

    System.getProperty("os.name") returns "Mac OS X" for me if you choose to go that route.

    I decompiled and recompiled with key code 157. Now it works perfectly.

    Thanks for the help! I'll try get it fixed soon, I have mini exams at school though so I don't have as much time.
    Quote from Spoyodude179»
    Hey dudearent. nice work on the computer.

    I'm 11 and I was wondering if you could help me test a programming design of my own that is similar to yours. it uses command blocks with testforblock to figure out what program code is in a command block and then places the torches in the correct position using clone. I don't know the most efficient way to organize the program-reading command blocks. PLZ help!!! :-)

    BTDubs: this is for my full color multi-function set (through programming) 3d GPU on an 8 bit computer



    -Spoyodude179

    I'm not quite sure what you're asking, and I'll need to know more about your setup and what you're trying to do to help.
    Also, a 3D GPU? How are you planning to do that? I'd love to see those designs.
    Posted in: Redstone Creations
  • 0

    posted a message on Commandore 32: Advanced command block based computer. Programming tutorial now available!
    Quote from eah2119»
    Blockloader.jar doesn't work properly on mac. It can open and close the chat fine, but it enters no text. I tried in 1.7 and it works correctly. The culprit, I bet, is that the 1.8 update changed the paste key combination on mac from control+V to command+V. It may also be worth noting that the command key on mac is similar in function to the windows key on windows. I suppose it needs to do a platform check and then use control+V for windows and command+V for mac.

    Wha? Why did that have to change?!
    the changer in paste key combination is certainly the reason why it no longer works. I was unaware they changed that, since I don't have a Mac myself. Why can't mac use CTRL-V like everyone else?
    Thanks for the useful bug report though, It would've taken me a lot longer to come to that conclusion if you hadn't told me of the paste changes in 1.8. Now I'm going to have to find out how to detect what OS my program's running on and change the used paste key combination accordingly. I'll try getting a fix working!
    Quote from eah2119»
    Also, I saw the limits of VRAM in the OP, but didn't see any mention of limits on other memory. How many instructions can it hold? How about limits on other data such as variables?

    The current program memory limit is 255 instructions. If you want it in kilobytes, that would *technically* be 255*3*4=3060 bytes = almost 3 kilobytes, since there are 3 4 byte numbers per instruction. However, The first number, the instruction ID, is currently always between 1 and 20 inclusive, and while I can add instructions, I doubt I'd ever add more than 255, or even come close, so assuming 1 byte for the first number:

    255*(1+4+4)=2295 bytes, or about 2.2 Kilobytes of program memory. Again, it's not likely the second and third numbers hit their upper or lower limits either, but it is possible.

    The amount of instructions needed to perform a certain task varies from computer to computer, of course, so this number's a little meaningless. The tic tac toe demo is 60 instructions (out of 255), the paint program is 23, the guess the number game is 31 and the bar graph program is 23.

    However, programs that hardcode things in can be pretty large due to the computer's lack of support for copying sequential blocks of memory to RAM. Therefore, the number drawing program, which hardcodes the design of digits 0 to 9, is 162 instructions out of 255. The letter drawing program by fez that hardcodes the first 9 letters of the english alphabet (and has some cool newline handling logic) takes up 246 instructions!
    Posted in: Redstone Creations
  • 0

    posted a message on Commandore 32: Advanced command block based computer. Programming tutorial now available!
    2 new tutorial episodes have been uploaded:

    input and loops (and a very simple calculator):



    ifs and more loops (and a reasonably advanced countdown program):





    Any yet there's still not that many user made programs. The only person making programs is me and fez. Perhaps I should host a programming contest like redstone wars. But what would the prize be... a steam game? paypal money? a shoutout? I've no clue yet.
    Posted in: Redstone Creations
  • 0

    posted a message on Commandore 32: Advanced command block based computer. Programming tutorial now available!
    I have some good news for you all!

    Firstly, fez5577 has created another program, "artist"! It draws random shapes in random places with random colours (randomly). Leave it running to produce some abstract art! It also has a pause/resume and clear feature. Great example of how you can use the built in random number generator. Download it here!

    Next up, episode 3 of the tutorial series is finally done! I try to demonstrate how to make your first program(s), and show off variables, math, and printing to the chat. I completely forgot that people may not know what "printing" means in programming (they might think it physically prints something on paper) and I used that term quite often. I silently noticed this about halfway through recording, but it was going too well and I didn't want to re-record it AGAIN.

    Posted in: Redstone Creations
  • 0

    posted a message on Commandore 32: Advanced command block based computer. Programming tutorial now available!
    Quote from c4ooo_redstone»
    did you even see me congratulating you before the update?

    Yes, I did, but I don't think there was anything to reply to. Congratz on the progress on your computer, I guess!

    Quote from Tjakka5»
    I'd recommend you assume that the viewer has some programming/logic experience. If you just keep that in mind it will be much easier to explain, and most people will be able to understand it, even though they don't know anything about it :P

    Hmm. I guess I could, but explaining the differences between this and all other languages might still be confusing. And there's still the difficult balance between common sense that needs no explanation and information that needs to be explained. But I think I've got a plan that might just work...

    Teachers must have tough jobs, especially IT teachers. I wonder what techniques they secretly use...
    Posted in: Redstone Creations
  • 0

    posted a message on Commandore 32: Advanced command block based computer. Programming tutorial now available!
    Quote from c4ooo_redstone»
    for the love of computing, please help.
    Can u go here:http://www.minecraftforum.net/forums/off-topic/computers-science-technology/computer-buying-building/2199752-pc-building-newbie#c11
    and explain the diferance betwean "building" and "assembling a xomputer.
    askebbling: buying all the parts and putting them together;
    building: buying all the IC and wire and breadboards and soldering them together.
    big thanks,
    --your semi-rival, German Kuznetsov

    I can't because, unfortunately for you, they are synonyms.
    The first definition for build as a verb is "construct (something) by putting parts or material together." putting computer parts together is therefore building a PC. Building a computer almost always refers to buying parts, such as a GPU, motherboard etc. and putting them together yourself.
    On the other hand, both building and assembling could also refer to making a computer using basic logic gates, as you say. However, their usage of it is still perfectly correct.

    pretend someone said they were building a tent. Most people will assume that they are going to take a tent set and put it together according to the instructions, because most people don't build tents from scratch.

    I believe the best way to word what you mean is "deigning a tent", or in your case "designing a computer", though that still isn't exactly correct since you are still making one, and you might be using someone else's design. Perhaps "building a computer from scratch", or "from logic gates".




    Anyway, that was completely off topic. As for progress on the tutorial series: explaining the concept of programming is hard! I've thrown out 2 recording attempts now. It's just so natural to me I struggle to explain it. It's like trying to explain how to speak or construct sentences. You aren't born with it, and you learn it from other people, but trying to tell someone else how it works is nearly impossible because you simply don't think about it when you are doing it, it just comes naturally! I might just as well try to explain the color blue to someone who was born blind. Anyone have any tips? I don't want to go into too many details, otherwise the episodes will be way too long.
    Posted in: Redstone Creations
  • To post a comment, please .