Jump to content


Tjakka5's Content

There have been 221 items by Tjakka5 (Search limited from 10-February 22)


By content type

See this member's


Sort by                Order  

#183560 CCJam: Results In!

Posted by Tjakka5 on 12 June 2014 - 07:07 PM in General

Pfff, Im going to start in ~10 hours, as I dont want to stay up all night.
Also, change of plans for me, I am also able to work on my program this Saturday, which is nice :)



#183004 CCJam: Results In!

Posted by Tjakka5 on 09 June 2014 - 05:45 PM in General

Once again, yes, I would like to participate.
I also have a question; Do all programs go, or are we supposed to make something thats actually useful?

Because that will determine if I'm going to program a game, or make my Todo list v2.



#181747 CCJam: Results In!

Posted by Tjakka5 on 01 June 2014 - 03:32 PM in General

I'd like to participate, but I wont be able to be there on Saturday.
This also means I'll have to relearn CCLua somewhat again >.<



#178326 Technical Breakdown

Posted by Tjakka5 on 13 May 2014 - 07:15 PM in General

Can we get a list of mods? That would be very helpful.



#177950 augustas656's read() replacement questions topic

Posted by Tjakka5 on 11 May 2014 - 01:05 PM in Ask a Pro

View Postviluon, on 11 May 2014 - 12:54 PM, said:

View PostTjakka5, on 11 May 2014 - 12:52 PM, said:

You could also do it like this:

local function test(func)
  if func == "a" then a()
  elseif func == "b" then b()
  elseif func == "c" then c()
end
local function a()
  print("a")
end
local function b()
  print("b")
end
local function c()
  print("c")
end
test('a")
test("c")
test("b")


I dont think this would be useful in anyway, but yeah, its somewhat possible.
How is this related to declaring a function in another function?
Edit:test('a") should be test("a") and it wouldn't work anyway, missing end of the if statement.

I'm sorry, it has been such a long time since I have programmed ComputerCraft stuff.
Also, the test('a") might work, but I'm not sure.



#177945 augustas656's read() replacement questions topic

Posted by Tjakka5 on 11 May 2014 - 12:52 PM in Ask a Pro

You could also do it like this:

local function test(func)
  if func == "a" then a()
  elseif func == "b" then b()
  elseif func == "c" then c() end
end
local function a()
  print("a")
end
local function b()
  print("b")
end
local function c()
  print("c")
end
test("a")
test("c")
test("b")


I dont think this would be useful in anyway, but yeah, its somewhat possible.



#177701 Boolean algebra. with ComputerCraft

Posted by Tjakka5 on 09 May 2014 - 08:51 PM in General

After much of bunnies, here's what I managed to come up with for the XOR, again, using only ORs and NOTs.
local function XOR(a, B)/>
  return OR(NOT(OR(AND(a, B)/>, NOT(a))), NOT(OR(AND(a, B)/>, NOT(B)/>)))
end

Next up I'll be dealing with half adders and full adders, which I can manipulate to do all the other logic gates using a demux.
Because adders have more variables (8 bit input, 8 bit output, 8 Cin's, 8 Couts) I probably have to setup some variables, unless I can come up with a smart way to... do stuff.



#177673 Boolean algebra. with ComputerCraft

Posted by Tjakka5 on 09 May 2014 - 03:31 PM in General

Im currently cracking my head over XOR while my sisters demand I draw bunnies; I'll post some progress later tonight.



#177671 Boolean algebra. with ComputerCraft

Posted by Tjakka5 on 09 May 2014 - 03:23 PM in General

It's also not supposed to be used in "real" programs, I'm simply doing this for fun, and as a learning experience also.
Technically you could eventually run programs on that CPU, but it would be simple programs like NIM I'd reckon, maybe, just maybe Pong.



#177668 Boolean algebra. with ComputerCraft

Posted by Tjakka5 on 09 May 2014 - 03:09 PM in General

View PostLignum, on 09 May 2014 - 03:03 PM, said:

View PostTjakka5, on 09 May 2014 - 02:58 PM, said:

Because I am a bad programmer when it comes to using those operators; thank for notifying me :)

And the things about this is to only be using those 2 functions, not anything like loops or if statements, as that would defeat the whole point.
Alright. But I'm pretty sure that making the equivalent of an if statement, a conditional jump, would be impossible with just these functions.

Yes, but, just to clarify things;

I am using ComputerCraft as a logic simulator. I gave it the 2 core things of binary, OR and NOT, so that you can create every logic gate with it, and eventually a CPU (I hope).



#177665 Boolean algebra. with ComputerCraft

Posted by Tjakka5 on 09 May 2014 - 02:58 PM in General

Because I am a bad programmer when it comes to using those operators; thank for notifying me :)

And the things about this is to only be using those 2 functions, not anything like loops or if statements, as that would defeat the whole point.



#177661 Speedhack

Posted by Tjakka5 on 09 May 2014 - 02:49 PM in Programs

Simple and fun, and I agree with Byte here; this probably shouldn't be seen as malicious. :P



#177660 Boolean algebra. with ComputerCraft

Posted by Tjakka5 on 09 May 2014 - 02:40 PM in General

Hey everyone,

I haven't played around with CC in a while, so I decided to do something with it that I have been into for ages;
Boolean Algebra.

You probably know what it is; it's just like redstone, it holds either the state true or false where true overwrites the false.
This is binary, and it's the core of every computer. You use it to make logic gates, so make a ALU, CPU, etc, the possibilies are endless.

So I wrote 2 small snippets of code that simulates the core of binary, the OR and NOT gate.
EDIT: Lignum gave me some better code; thanks
local function OR(a, B)/>/>
  return a or b
end

local function NOT(a)
  return not a
end

The OR gate will look at both inputs, and if either of them is true it will return true.
The NOT gate will return the opposite of the value of the input, so if a is true, it will return false and vice versa.

Using this, and only this, no if statements, no loops, no math. functions we can create everything, and that's what I wanted to share with you guys.


I'll keep this thread updated as I create more things with these 2 basic functions, and my goal will be to have a simple 8 bit CPU.


AND Gate:
Spoiler



#168436 Guess Who's Below

Posted by Tjakka5 on 16 March 2014 - 04:15 PM in Forum Games

Nope!

Engineer? :D



#168435 Pi calculator V2 Infinite decimals!

Posted by Tjakka5 on 16 March 2014 - 04:13 PM in Programs

Gah, why didnt you post this 2 days ago?!
It was Pi day then!



#165129 Probably just a basic question

Posted by Tjakka5 on 17 February 2014 - 02:37 AM in Ask a Pro

local flag = false
while not flag do
  input = read()
  if input ~= "Ponies" then
    flag = true
  end
end
--Other code

I believe that should work.



#162854 How would you simulate a programming language in the language Lua?

Posted by Tjakka5 on 31 January 2014 - 02:32 PM in General

Yeah, I was talking about designing a basic programming language, and using lua as a interpreter for that.
I have heard and read that's it's really complicated, so I'll read up on the compiler theory as Yevano suggested for now.



#162685 How would you simulate a programming language in the language Lua?

Posted by Tjakka5 on 30 January 2014 - 02:32 PM in General

I have an idea for a project, which would basically be, create a simple programming language in lua.
I however, have no idea how you would simulate a language in lua, so I was hoping if any of you could give me some tips/guidelines, etc.

Thanks in advance.



#162011 Pokémon

Posted by Tjakka5 on 26 January 2014 - 02:10 AM in General

Can I be a porygon? :P



#158169 Corrupt-A-Wish!

Posted by Tjakka5 on 26 December 2013 - 03:53 PM in Forum Games

Granted, however, all the data stored on any device is corrupted and unable to be ever retrieved again.

I wish the logic in my love2d game would actually work properly.



#157410 Todo list.

Posted by Tjakka5 on 20 December 2013 - 10:12 AM in Programs

View PostDeath, on 18 December 2013 - 08:30 PM, said:

I could easily do it.
Give me less than an hour and I'll add in support for two, along with a few minor bug fixes.

EDIT: Yeah, I'm not even going to begin on how bad looking at that code hurt my eyes.
It's the kind of code you accept works, but it doesn't need to be clean.
I'm not editing that.
I'll make a new one.

Goodluck, logic's a dick.



#153091 Rendering Buffering/double Buffering?

Posted by Tjakka5 on 16 November 2013 - 05:58 AM in Ask a Pro

From the comments I have seen on these forums I saw that the biggest problems with big programs were that the screen was flickering.

I am guessing this was because the way you would print the GUI is that you calculate a piece, render it, calculate, render, etc for 1 frame.
I instantly thought this could be fixed by making a buffer (What is probably the thing that everyone does), meaning that you calculate something, store it somehow, calculate the next thing, store it, and print every frame in one go without calculating.

Is this right? And if so, how would you do that?



#151090 Anyone Feel Like Testing This? (ftb)

Posted by Tjakka5 on 29 October 2013 - 01:02 PM in General

Doesnt work.



#150085 Team A Vs Team B

Posted by Tjakka5 on 23 October 2013 - 08:21 AM in Forum Games

Oh gosh.

Team B
Old total: 20
New total: 25



#149670 Team A Vs Team B

Posted by Tjakka5 on 20 October 2013 - 12:09 PM in Forum Games

Team B
Old total: 95
New total: 100