This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
27thColt's profile picture

Colt's Calculator-Adds you own calculator to your game!

Started by 27thColt, 16 April 2013 - 01:42 AM
27thColt #1
Posted 16 April 2013 - 03:42 AM
Colt's Calculator

This is Colt's Calculator,a calculator for your computer!

In this,you can add,subtract,multiply,divide,and see if a number is greater than,less than,and equal to the next!

Changelog

SpoilerVersion 1.0

-6 new features

-add

-subtract

-multiply

-divide

-greater than

-less than

Help

Find any problems?Need help?

Suggestions?

Just post something commenting on what you

want to spit out!

Download


OR

type pastebin get hW6Nbm0F coltscalculator on your computer

(if you have http:// feature enable in your config)


After,just type in coltsCalculator on your computer!

Code

Spoiler


--Colt's Calculator v1 created by 27thColt

--Variables
local number1
local number2
local operation
local gt ="is greater than"
local lt ="is less than"
local et ="is equal to"
local start
--Clears out other text
term.clear()
--The Actual Calculator Code
term.setTextColor(2)
print"This is Colt's Calculator.A Calculator that me,27thColt created."
print"Let us start"
--Picking out Number 1 & Number 2
term.setTextColor(4)
print"Please pick your first number"
term.write()
number1 = read()
print("You have picked number " ..number1)
term.setTextColor(32)
print"Please pick your second number"
term.write()
number2 = read()
print("You have picked number " ..number2)
print("Your numbers are " ..number1.. " and " ..number2)
print("Now,pick an operation.You may use these operations +,-,*,/,>,<.")
term.write()
operation = read()
--Options for operations
if operation=="+" then
   term.setTextColor(64)
   print(number1.. " + " ..number2.. " = " ..number1+number2)
end

if operation=="-" then
   term.setTextColor(256)
   print(number1.. " - " ..number2.. " = " ..number1-number2)
end

if operation=="*" then
  term.setTextColor(512)
  print(number1.. " * " ..number2.. " = " ..number1*number2)
end

if operation=="/" then
  term.setTextColor(1024)
  print(number1.. " / " ..number2.. " = " ..number1/number2)
end

if operation==">" then
  if number1>number2 then
	term.settextColor(2048)
	print(number1.. " " ..gt.. " " ..number2)
  end
  if number1<number2 then
	print(number1.. " " ..lt.. " " ..number2)
  end
  if number1==number2 then
	print(number1.. " " ..et.. " " ..number2)
  end
end

if operation=="<" then
  if number1<number2 then
	print(number1.. " " ..lt.. " " ..number2)
  end
  if number1>number2 then
	print(number1.. " " ..gt.. " " ..number2)
  end
  if number1==number2 then
	print(number1.. " " ..et.. " " ..number2)
  end
end

--The End
term.setTextColor(16)
print("Thank you for using Colt's calculator.To use it again type coltscalculator.")
[center][size=5]

Pictures

Spoiler


nutcase84 #2
Posted 16 April 2013 - 06:15 AM
No pics, no clicks.
Sammich Lord #3
Posted 16 April 2013 - 07:25 AM
No pics, no clicks.
You post that on almost any post. At least put some logical reasoning as to why they should post pictures.
M4sh3dP0t4t03 #4
Posted 16 April 2013 - 07:58 AM
"pastebin get hW6Nbm0F" wouldn't work you have to use "pastebin get hW6Nbm0F coltsCalculator". But except this little mistake in this thread it seems like a nice little calculator, even if there are better ones, but most of them require an advanced computer(ok, but why would you even need any calculator inside minecraft:P)
Jian #5
Posted 16 April 2013 - 03:23 PM

--Options for operations
if operation=="+" then
   term.setTextColor(64)
   print(number1.. " + " ..number2.. " = " ..number1+number2)
elseif operation=="-" then
   term.setTextColor(256)
   print(number1.. " - " ..number2.. " = " ..number1-number2)
elseif operation=="*" then
  term.setTextColor(512)
  print(number1.. " * " ..number2.. " = " ..number1*number2)
elseif operation=="/" then
  term.setTextColor(1024)
  print(number1.. " / " ..number2.. " = " ..number1/number2)
elseif operation==">" then
  if number1>number2 then
	    term.settextColor(2048)
	    print(number1.. " " ..gt.. " " ..number2)
  elseif number1<number2 then
	    print(number1.. " " ..lt.. " " ..number2)
  elseif number1==number2 then
	    print(number1.. " " ..et.. " " ..number2)
  end
elseif operation=="<" then
  if number1<number2 then
	    print(number1.. " " ..lt.. " " ..number2)
  elseif number1>number2 then
	    print(number1.. " " ..gt.. " " ..number2)
  elseif number1==number2 then
	    print(number1.. " " ..et.. " " ..number2)
  end
else error("some kinda error!")
end

just the first thing i noticed
oeed #6
Posted 16 April 2013 - 05:09 PM
No pics, no clicks.
You post that on almost any post. At least put some logical reasoning as to why they should post pictures.

Yes, he does post that in almost every post, but he is actually helping the poster… sorta.

Coming from a marketing point of view, if you want someone to take time out of their day to look at your product you have to make it attractive and give them a reason to take a look at it. No one really wants to read a wall of text, but if they see a picture/advertisement of the product they will have a much higher chance of purchasing, or in our case downloading.

Trust me, there is merit in having pictures. If I don't see a screenshot I almost never download it. I just can't be bothered.
So in short, while it could be called 'rude', there is merit behind nutcase's statement.
theoriginalbit #7
Posted 16 April 2013 - 05:16 PM
Yes, he does post that in almost every post, but he is actually helping the poster… sorta.

Coming from a marketing point of view, if you want someone to take time out of their day to look at your product you have to make it attractive and give them a reason to take a look at it. No one really wants to read a wall of text, but if they see a picture/advertisement of the product they will have a much higher chance of purchasing, or in our case downloading.

Trust me, there is merit in having pictures. If I don't see a screenshot I almost never download it. I just can't be bothered.
So in short, while it could be called 'rude', there is merit behind nutcase's statement.
While I do agree with the premise of what you are saying, he is getting VERY annoying with going to posts and saying it, even when they say 'coming soon' and the such… The other day he actually necro'd a post JUST to say "no pics, no clicks"… Also I don't know whether you actually kept up-to-date with NutOS but it took him 7 months to get a screenshot on his thread, I think he needs to start cutting some people some slack, getting over himself, and posting something useful other than "No pics, no clicks". Oh and a final point, quite a lot of stuff he posts on does get quite a lot of clicks, so his statement is kinda redundant anyways.
Spongy141 #8
Posted 16 April 2013 - 06:02 PM
The installer is wrong, you need to enter a file name, it won't auto make a name for you….
oeed #9
Posted 16 April 2013 - 08:23 PM
–snip–
While I do agree with the premise of what you are saying, he is getting VERY annoying with going to posts and saying it, even when they say 'coming soon' and the such… The other day he actually necro'd a post JUST to say "no pics, no clicks"… Also I don't know whether you actually kept up-to-date with NutOS but it took him 7 months to get a screenshot on his thread, I think he needs to start cutting some people some slack, getting over himself, and posting something useful other than "No pics, no clicks". Oh and a final point, quite a lot of stuff he posts on does get quite a lot of clicks, so his statement is kinda redundant anyways.

Point taken.
Entropy #10
Posted 17 April 2013 - 12:26 AM
Nice, simple but I like it. Also, you wouldn't really need pics for a program this simple you can imagine how it would look xD.
27thColt #11
Posted 17 April 2013 - 01:32 AM
–snip–
While I do agree with the premise of what you are saying, he is getting VERY annoying with going to posts and saying it, even when they say 'coming soon' and the such… The other day he actually necro'd a post JUST to say "no pics, no clicks"… Also I don't know whether you actually kept up-to-date with NutOS but it took him 7 months to get a screenshot on his thread, I think he needs to start cutting some people some slack, getting over himself, and posting something useful other than "No pics, no clicks". Oh and a final point, quite a lot of stuff he posts on does get quite a lot of clicks, so his statement is kinda redundant anyways.

Point taken.

Okay,well,pictures will come soon.But I hope you guys like it still!