/*
* 0xFFF1:
* This program draws Yin and Yang
* with as few changes of setColor as needed
* also draws some text to display some information
* about my drawing.
*/
import javax.swing.JApplet;
import java.awt.*;
public class Lab2 extends JApplet{
private static final long serialVersionUID = 1L;
public void init()
{
setSize(640,480);
Container c = getContentPane();
c.setBackground(Color.YELLOW);
}
public void paint(Graphics g)
{
super.paint(g);
g.setColor(Color.WHITE);
g.fillArc(80, 0, 480, 480, 90, 180);
g.setColor(Color.BLACK);
g.fillArc(80, 0, 480, 480, 270, 180);
g.fillArc(200, 240, 240, 240, 90, 180);
g.setColor(Color.WHITE);
g.fillArc(200, 0, 240, 240, 270, 180);
g.fillArc(290, 330, 60, 60, 0, 360);
g.setColor(Color.BLACK);
g.fillArc(290, 90, 60, 60, 0, 360);
g.setFont(new Font("Arial", 0, 12));
g.setColor(Color.GREEN);
g.drawString("Yin and Yang",0,18);
g.setFont(new Font("Courier", 0, 12));
g.drawString("Drawn by 0xFFF1", 0, 36);
g.setFont(new Font("Times New Roman",0,12));
g.drawString("Referenced from Google Images Search",0,480);
}
}
One of my recent labs done for an online java applets programming college course.
Additional Info:
I also know lua.
OK, i got some better code, ill put it up
(made this awhile ago, forgot about it)
function newT()
local _t = {}
local mt = {}
mt.__call = function()
return _t
end
return setmetatable( {},mt )
end
function newT2()
local t = {}
local mt = {}
mt.__index = {
[t] = {}
}
return setmetatable( t,mt )
end
function newT3()
local mt = {}
mt.__index = {
_t = {}
}
return setmetatable( {},mt )
end
function newT4()
local t = {}
t._t = {}
return t
end
* In game name: Pieperson2222
* Age (minimum 12 years): 14
* Screenshot/world save/text file/anything that shows
that you know programming:
Here's a password protection program I wrote on another computercraft
print "Hello, User!"
write "Password: "
pass = read("*")
if pass == "cheese" then
print "Welcome!"
sleep(2)
term.clear()
term.setCursorPos(1,1)
else print "Password Incorrect. Shutting down"
shell.run "shutdown"
end
* Additional anything: Cheese isn't actually the password I use, before any of you try.
* In game name: ihaveamac
* Age (minimum 12 years): 14 (yes 14)
* Screenshot/world save/text file/anything that shows
that you know programming:
print("Recovery disk loaded by ihaveamac")
print("Checking for startup file on computer")
if fs.exists("startup") then
print("Startup file found")
print("Check or edit contents: c, Delete file: d, Cancel: e")
input = false --This was going to do something but I decided not to.
repeat
local e,a = os.pullEvent()
if e == "char" then
if a == "c" then
shell.run("edit", "startup")
print("Done editing startup file, exiting")
sleep(1)
os.shutdown()
elseif a == "d" then
fs.delete("startup")
print("Deleted startup, exiting")
sleep(1)
os.shutdown()
elseif a == "e" then
print("Exiting")
sleep(1)
os.shutdown()
end
end
until input
else
print("No startup file found on your computer, exiting recovery")
sleep(2)
os.shutdown()
end
A recovery program. Put it on a disk, call it startup, and you can recover a computer from a startup virus. In single player, you can just go to the save in .minecraft but in multiplayer it's a very useful tool. :smile.gif:
* Additional anything: I like the rednet feature, I use it quite a bit. I'm trying to make a messenger using 2 local computers. :smile.gif:
Also in the program, it says that "input" is false and the repeat loop waits for it to be true, but the script will shut down the computer before it ever finishes. I was just too lazy to change it so I left it like that. Still works as intended.
Rollback Post to RevisionRollBack
the post you are looking at was posted by ihaveamac
* In game name: Jkjkelly1
* Age (minimum 12 years):14
* Screenshot/world save/text file/anything that shows
that you know programming: (print "Hello there") But in all seriousness, i do know more, i just cant put it here. I could show you more.
* Additional anything: Im interested in learning a bit.
In game name: McLovn73
Age: 15
My first Lua Code for controling minecraft lights:
i = 10
correctpassword = "7250"
while i>5 do
term.clear()
term.setCursorPos(1,1)
sleep(0.15)
if rs.getInput ("back") == true then
print ("Light Status: Online")
else
print ("Light Status: Offline")
end
print ("Enter Password: ")
answer = read()
if answer == correctpassword then
if rs.getInput ("back") == true then
rs.setOutput ("back", false)
else
rs.setOutput ("back", true)
end
else
print ("Access Denied")
print ("Shutting Down")
sleep(1)
os.shutdown()
end
end
i would like to come on and further develop my knowldge of lua and would love to the the creations people have made
Age: 20
One of my recent labs done for an online java applets programming college course.
Additional Info:
I also know lua.
Age: 14(2/3)
Proof:
simple dispense program:
redstone.setOutput("left", true)
sleep(0.5)
redstone.setOutput("left", false)
print("Dispense Complete")
Additional info: I know redstone very well... I have created a "disk" that stores data using pistons, wool, and glass.
@ Epicism/Sykken: That code is very very basic, and don't even work... Show me something more advanced.
(made this awhile ago, forgot about it)
* Age (minimum 12 years): 14
* Screenshot/world save/text file/anything that shows
that you know programming:
Here's a password protection program I wrote on another computercraft
print "Hello, User!"
write "Password: "
pass = read("*")
if pass == "cheese" then
print "Welcome!"
sleep(2)
term.clear()
term.setCursorPos(1,1)
else print "Password Incorrect. Shutting down"
shell.run "shutdown"
end
* Additional anything: Cheese isn't actually the password I use, before any of you try.
age: 13
proof: ok ill copy some text from a screenshot i have :tongue.gif:
password = "Andrew_Kraft"
wirte "Password: "
input = read()
if input == password then
print "Welcome!"
rs.setOutput ("left", false)
rs.setOutput ("right", false)
rs.setOutput ("back", false)
sleep(3)
rs.setOutput ("left", true)
rs.setOutput ("right", true)
rs.setOutput ("back", true)
shell.run ("clear")
else
print "Incorrect!"
shell.run ("lock"
end
lol thats a passlock snippit off of my first os
yea i saw the typos and the reason the outputs are reversed is because the doors were being glitchy and thats what worked
* Age (minimum 12 years): 14 (yes 14)
* Screenshot/world save/text file/anything that shows
that you know programming:
A recovery program. Put it on a disk, call it startup, and you can recover a computer from a startup virus. In single player, you can just go to the save in .minecraft but in multiplayer it's a very useful tool. :smile.gif:
Also in the program, it says that "input" is false and the repeat loop waits for it to be true, but the script will shut down the computer before it ever finishes. I was just too lazy to change it so I left it like that. Still works as intended.
Age: 18
Code:
- PyGame Snippet (in Python) -
- Password Protected OS -
Additional Info: My Lua knowledge with ComputerCraft is limited but I'm always interested in learning more. This server seems like a good start.
Was I skipped? :huh.gif:
You're WL'ed now.
Ok, thanks. I'll come on after school.
user name:ash5784
my code:
minutes = 0
hours = 0
function clock()
for seconds = 0, 60, 1 do
shell.run("clear")
print (hours, ":",minutes,">", seconds)
print ("hours:minutes>seconds")
if seconds == (60) then
minutes = minutes + 1
clock()
end
if minutes == (60) then
hours = hours + 1
minutes = 0
end
sleep (1)
end
seconds = 0
end
clock()
one reason i want to join is to learn a bit more about scripting because well im not a "master"
* Age (minimum 12 years):14
* Screenshot/world save/text file/anything that shows
that you know programming: (print "Hello there") But in all seriousness, i do know more, i just cant put it here. I could show you more.
* Additional anything: Im interested in learning a bit.
Age: 15
My first Lua Code for controling minecraft lights:
i = 10
correctpassword = "7250"
while i>5 do
term.clear()
term.setCursorPos(1,1)
sleep(0.15)
if rs.getInput ("back") == true then
print ("Light Status: Online")
else
print ("Light Status: Offline")
end
print ("Enter Password: ")
answer = read()
if answer == correctpassword then
if rs.getInput ("back") == true then
rs.setOutput ("back", false)
else
rs.setOutput ("back", true)
end
else
print ("Access Denied")
print ("Shutting Down")
sleep(1)
os.shutdown()
end
end
i would like to come on and further develop my knowldge of lua and would love to the the creations people have made