Hey the project is coming back!
I am working on a project that you type in scratch code and the project will then process and give you a string of code to type into a note document to be compiled into a .class file. So I am looking for someone who knows Java (NOT JavaScript), java swing, awt, ect. So if you do know that stuff just post a reply and I'll show you what I was working on and what I need help with. Note: I will not be a snob and say I created it all by myself 50 50 credit will be given. Also the project will have to be updated with each Java update.
Here is the block codes(scratch code):
when gf clicked is the code for:
when gf clickedforever code inside the block end is the code for:
forever Put something in here. endIf you haven't noticed we are using the block codes for the forms that have the scratch blocks tag.
members
>Proanimation (me) - creating project
>YMIBANWAH - helped with some Java code
> slayerrobe7 - helping with Java code
need to be done
> create an ad project
> create a block code giving project (see me for further explaination)
> Java code for separate blocks (see me for further explaination)
These are the parts of the project that have to be done
---------------------------------------------------------------------------------------------------
Last edited by Proanimation (2012-11-05 18:23:49)
Offline
I am learning java i could help with some things possibly. I could do if loops and things. Plus variables and some operators. It will require a lot of scripts because java is object oriented but i can still help. You will still want another java guy.
Offline
Yeah I'll definitely need another person that knows Java. I will need your help with the loops. I know how to make a GUI in Java but, I don't know about loops, the if operation (see I don't even know how to type it) and such. Reply back to me on how to use different loops and such.I have already got started with the project I will release the current version tomorrow.
Offline
This is the infinite loop which could be used for forever
// infinite loop
for (; ;) {
// your code goes here
This is the if-then which could be used for if
if (your condition goes here) {
// your code goes here
This is the if-then-else
if (your condition goes here) {
// the first method goes here
} else {
// the second method goes here
}
Last edited by YMIBANWAH (2012-08-14 11:15:52)
Offline
Thanks! I will definitely be using them. Can you try to make a program in scratch that singles out words (see first post for example) so we can finally make some headway with the converter.
Offline
YMIBANWAH wrote:
This is the infinite loop which could be used for forever
// infinite loop
for (; {
// your code goes here
This is the if-then which could be used for if
if (your condition goes here) {
// your code goes here
This is the if-then-else
if (your condition goes here) {
// the first method goes here
} else {
// the second method goes here
}
the thing with infinite loops is that there is no execution pause time
Offline
Is java really the best language to do this in? There are simpler ones with equal abilities, python for example, requires little syntax, and loops are easier (while 1: for a forever, break to end the loop)
Offline
zammer990 wrote:
Is java really the best language to do this in? There are simpler ones with equal abilities, python for example, requires little syntax, and loops are easier (while 1: for a forever, break to end the loop)
First of all if I were to finally make this work or complete it you could easily change it to a Scratch to Python converter easily. Also I really don't think it matters because all of the programming languages all have one thing in common. To be used or in other words they all can be turned into a .exe file.
Offline
I know Java and all that, but there's already a tool for this. It works better too. You don't do any typing, you just give it a Scratch project (.sb) and convert it straight into a Java archive (.jar). No typing in long lines of code and no manually compiling it.
Offline
Thrystor wrote:
I know Java and all that, but there's already a tool for this. It works better too. You don't do any typing, you just give it a Scratch project (.sb) and convert it straight into a Java archive (.jar). No typing in long lines of code and no manually compiling it.
Yes I have seen that but with a scratch project as the converter it will work for all versions of scratch. So when scratch 2.0 comes out the .jar file won't work because scratch 2.0 is rewritten in flash but with this all you have to do is type in the block codes and it will give you a string of Java code to compile into a .class file. Also someone could easy remix the converter so that it converts it into a different programming language such as C++,Python,JavaScript,ect.
Offline
i ave read several books on Java and have a good grasp on the language...(I will probably be more help after my next investment) however i could be lots of help now
here is a project i made in one of my tutorial books. (i just don't want to type stuff out right not so im copy pasting)
import java.awt.*; import javax.swing.*; import java.awt.event.*; class PrimeFinder extends JFrame implements Runnable, ActionListener { Thread go; JLabel howManyLabel = new JLabel("Quantity: "); JTextField howMany = new JTextField("400", 10); JButton display = new JButton("Display primes"); JTextArea primes = new JTextArea(8, 40); PrimeFinder() { super("Find Prime Numbers"); setSize(400, 300); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); BorderLayout bord = new BorderLayout(); setLayout(bord); display.addActionListener(this); JPanel topPanel = new JPanel(); topPanel.add(howManyLabel); topPanel.add(howMany); topPanel.add(display); add(topPanel, BorderLayout.NORTH); primes.setLineWrap(true); JScrollPane textPane = new JScrollPane(primes); add(textPane, BorderLayout.CENTER); setVisible(true); } public void actionPerformed(ActionEvent event) { display.setEnabled(false); if (go == null) { go = new Thread(this); go.start(); } } public void run() { int quantity = Integer.parseInt(howMany.getText()); int numPrimes = 0; // candidate: the number that might be prime int candidate = 2; primes.append("First " + quantity + " primes:"); while (numPrimes < quantity) { if (isPrime(candidate)) { primes.append(candidate + " "); numPrimes++; } candidate++; } } public static boolean isPrime(int checkNumber) { double root = Math.sqrt(checkNumber); for (int i = 2; i <= root; i++) { if (checkNumber % i == 0) { return false; } } return true; } public static void main(String[] arguments) { PrimeFinder fp = new PrimeFinder(); } }
when this is run it finds all prime numbers between 1 and a specified number
Last edited by slayerrobe7 (2012-08-16 22:55:56)
Offline
slayerrobe7 wrote:
i ave read several books on Java and have a good grasp on the language...(I will probably be more help after my next investment) however i could be lots of help now
I will add you to the list of members.
Offline
Proanimation wrote:
slayerrobe7 wrote:
i ave read several books on Java and have a good grasp on the language...(I will probably be more help after my next investment) however i could be lots of help now
I will add you to the list of members.
thank you
Offline
slayerrobe7 wrote:
Proanimation wrote:
slayerrobe7 wrote:
i ave read several books on Java and have a good grasp on the language...(I will probably be more help after my next investment) however i could be lots of help now
I will add you to the list of members.
thank you
Can you tell me which part of the project you want to work on?
Offline
Proanimation wrote:
slayerrobe7 wrote:
Proanimation wrote:
I will add you to the list of members.thank you
Can you tell me which part of the project you want to work on?
coding in scratch and java
Offline
slayerrobe7 wrote:
Proanimation wrote:
slayerrobe7 wrote:
thank youCan you tell me which part of the project you want to work on?
coding in scratch and java
What I mean by picking a part is to pick from the parts on the first post. (look at the fist post I updated it)
Offline
Proanimation wrote:
slayerrobe7 wrote:
Proanimation wrote:
Can you tell me which part of the project you want to work on?coding in scratch and java
What I mean by picking a part is to pick from the parts on the first post. (look at the fist post I updated it)
the java code for separate blocks.
Offline
YMIBANWAH wrote:
What is java code for separate blocks. I might be able to do that. If you want code for different blocks then I can do that. It might be a little over a week before I can start though.
The Java code for different blocks means that you pick one block at a time and create some code in Java that would do the same thing as the block.
Example: I picked the forever block so I would use:
for (; ;) { //other code goes in here }
Offline
bump
Offline
now what do i do
Offline
slayerrobe7 wrote:
now what do i do
Go and start on making Java code for a block(s).
If you don't know what I mean look at the post that is three posts away from this post.
Offline
alright here is a code that all games will need to run inside for it opens the window..
note: the symbol <> in this means that these areas will be different for every project
//First it would be best to have the necessary imports defined.. import javax.swing.*; import java.awt.event*; import java.awt.*; //this code may get confusing public class <projectNAME> extends JFrame implements KeyListener, ActionListener { //code will go here <name here>d() { super("<nameHere>"); setSize(SIZE HERE); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //code will go here setVisible(true); } Public static void main(String[] args) { <name of project here> pr = new <name of project here> }
Offline
Thanks I will add it to the converter.
Though I had the converter add the imports only when they were necessary
Last edited by Proanimation (2012-08-22 12:41:21)
Offline