poopo wrote:
wmays wrote:
Just wondering, but is it possible to define methods like for? Sort of like this...
Code:
repeat(10) { //code to be executed }Is there a way to define the repeat(){} method? I'm making a library for scratch users who want to learn java... it will be like Scratch (sorta).
I don't think there is. I'd be happy to help as I know some tricks that might be helpful.
Gotcha. I might even rewrite scratch in Java... I've been learning some tricks, too.
Offline
wmays wrote:
poopo wrote:
wmays wrote:
Just wondering, but is it possible to define methods like for? Sort of like this...
Code:
repeat(10) { //code to be executed }Is there a way to define the repeat(){} method? I'm making a library for scratch users who want to learn java... it will be like Scratch (sorta).
I don't think there is. I'd be happy to help as I know some tricks that might be helpful.
Gotcha. I might even rewrite scratch in Java... I've been learning some tricks, too.
if you are please say since i've sort of started this but will need more contributors
Offline
TRocket wrote:
wmays wrote:
poopo wrote:
I don't think there is. I'd be happy to help as I know some tricks that might be helpful.Gotcha. I might even rewrite scratch in Java... I've been learning some tricks, too.
if you are please say since i've sort of started this but will need more contributors
I could help, I suppose.
Also, for a repeat loop, you could just have a counter variable and increase it by one until it reaches a given amount. PROTIP: use counter++; instead of counter = counter + 1; it saves space and looks cleaner.
Offline
16Skittles wrote:
TRocket wrote:
wmays wrote:
Gotcha. I might even rewrite scratch in Java... I've been learning some tricks, too.if you are please say since i've sort of started this but will need more contributors
I could help, I suppose.
Also, for a repeat loop, you could just have a counter variable and increase it by one until it reaches a given amount. PROTIP: use counter++; instead of counter = counter + 1; it saves space and looks cleaner.
That's not the point... also, outside of for for loops, counter++ or i++ doesn't work.
Anyway, the point is to simulate scratch.
Offline
java isn't just good for games, it's good for creating things like pop ups or scrolling ads for websites.
Here's the tutorial im using.
Offline
wmays wrote:
16Skittles wrote:
TRocket wrote:
if you are please say since i've sort of started this but will need more contributorsI could help, I suppose.
Also, for a repeat loop, you could just have a counter variable and increase it by one until it reaches a given amount. PROTIP: use counter++; instead of counter = counter + 1; it saves space and looks cleaner.That's not the point... also, outside of for for loops, counter++ or i++ doesn't work.
Anyway, the point is to simulate scratch.
What are you talking about? The ++ operator works everywhere.
Also, how do you intend on recreating Scratch using Java, and what exactly would the purpose be? Limiting a powerful object-oriented language like Java to the minimal feature set of Scratch seems counter-intuitive to anything other than getting comfortable with using text.
Offline
Harakou wrote:
wmays wrote:
16Skittles wrote:
I could help, I suppose.
Also, for a repeat loop, you could just have a counter variable and increase it by one until it reaches a given amount. PROTIP: use counter++; instead of counter = counter + 1; it saves space and looks cleaner.That's not the point... also, outside of for for loops, counter++ or i++ doesn't work.
Anyway, the point is to simulate scratch.What are you talking about? The ++ operator works everywhere.
Also, how do you intend on recreating Scratch using Java, and what exactly would the purpose be? Limiting a powerful object-oriented language like Java to the minimal feature set of Scratch seems counter-intuitive to anything other than getting comfortable with using text.
MathW did an awesome version of scratch in Java, but never released it.
You couldn't drag blocks to the other pane because it was separate.
And anyways, I really don't see why you're asking them 'what's the point'. You didn't ask Jens that for Snap.
Offline
Harakou wrote:
wmays wrote:
16Skittles wrote:
I could help, I suppose.
Also, for a repeat loop, you could just have a counter variable and increase it by one until it reaches a given amount. PROTIP: use counter++; instead of counter = counter + 1; it saves space and looks cleaner.That's not the point... also, outside of for for loops, counter++ or i++ doesn't work.
Anyway, the point is to simulate scratch.What are you talking about? The ++ operator works everywhere.
Also, how do you intend on recreating Scratch using Java, and what exactly would the purpose be? Limiting a powerful object-oriented language like Java to the minimal feature set of Scratch seems counter-intuitive to anything other than getting comfortable with using text.
If you're gonna say that, so what about, why limit Squeak to Scratch?
Offline
scimonster wrote:
Harakou wrote:
wmays wrote:
That's not the point... also, outside of for for loops, counter++ or i++ doesn't work.
Anyway, the point is to simulate scratch.What are you talking about? The ++ operator works everywhere.
Also, how do you intend on recreating Scratch using Java, and what exactly would the purpose be? Limiting a powerful object-oriented language like Java to the minimal feature set of Scratch seems counter-intuitive to anything other than getting comfortable with using text.If you're gonna say that, so what about, why limit Squeak to Scratch?
Or why make modifications of Scratch?
Offline
ProgrammingFreak wrote:
scimonster wrote:
Harakou wrote:
What are you talking about? The ++ operator works everywhere.
Also, how do you intend on recreating Scratch using Java, and what exactly would the purpose be? Limiting a powerful object-oriented language like Java to the minimal feature set of Scratch seems counter-intuitive to anything other than getting comfortable with using text.If you're gonna say that, so what about, why limit Squeak to Scratch?
Or why make modifications of Scratch?
Well, modding Scratch adds features...
Offline
scimonster wrote:
ProgrammingFreak wrote:
scimonster wrote:
If you're gonna say that, so what about, why limit Squeak to Scratch?Or why make modifications of Scratch?
Well, modding Scratch adds features...
Oh, don't get me wrong. I understand and agree that we should have mods.
It just seems Harakou questioned why we should make things already created.
Offline
*RAGE AT HOW SCHOOL BLOCKS THE DOWNLOAD OF SLICK-UTIL!!!*
(It's a library to make it easier to load graphics and stuff for use with openGL)
Offline
Harakou wrote:
wmays wrote:
16Skittles wrote:
I could help, I suppose.
Also, for a repeat loop, you could just have a counter variable and increase it by one until it reaches a given amount. PROTIP: use counter++; instead of counter = counter + 1; it saves space and looks cleaner.That's not the point... also, outside of for for loops, counter++ or i++ doesn't work.
Anyway, the point is to simulate scratch.What are you talking about? The ++ operator works everywhere.
Also, how do you intend on recreating Scratch using Java, and what exactly would the purpose be? Limiting a powerful object-oriented language like Java to the minimal feature set of Scratch seems counter-intuitive to anything other than getting comfortable with using text.
It would help with learning and transition to other languages. Having so many functions and stuff can be really overwhelming for new users.
Offline
slinger wrote:
Lol, you're planning on programming at school xD
Yes, so what? Currently I am in a study hall, and in some classes we never do anything anyway...
Offline
On occasion I will write programs in Java, but I prefer C++. If I'm making a GUI or a game I use Java.
Offline
poopo wrote:
Just for the record the reseon you can't make a repeat block is because you would be unable to get the code inside of it. Unless of course you want to program a parser to...Didn't think so
Well, you could make a method for each class like that. For example,
Public static repeat (String function, int args int times) int counter = 0; while(counter<times){ if (function.equals("move steps"){ moveSteps(args); } else if (function.equals("switch to costume")) { switchtocostume(args); } counter++; } }
And so on.
Last edited by 16Skittles (2012-02-27 15:43:15)
Offline
veggieman001 wrote:
Harakou wrote:
wmays wrote:
That's not the point... also, outside of for for loops, counter++ or i++ doesn't work.
Anyway, the point is to simulate scratch.What are you talking about? The ++ operator works everywhere.
Also, how do you intend on recreating Scratch using Java, and what exactly would the purpose be? Limiting a powerful object-oriented language like Java to the minimal feature set of Scratch seems counter-intuitive to anything other than getting comfortable with using text.It would help with learning and transition to other languages. Having so many functions and stuff can be really overwhelming for new users.
I completely agree there, but that's generally why you use something that slowly introduces you to the concepts and libraries.
I think I need to clarify what I was thinking though: The impression I got was that he would somehow be making a Java interpreter that took Java syntax and made it effectively text-based Scratch, which seemed (to be honest) a little silly. I'm not discouraging such an idea, it's just my opinion that it would fill a very narrow window for learning. (Then again, maybe I'm wrong! The simplicity of Scratch paired with a much faster language is enticing.)
I like the idea of a text-based Scratch, however, and Java might be a good way to go about it. If that's what wmays meant, sorry for the confusion.
@ProgrammingFreak: What's Snap? I can't say I've heard of it.
Offline
Harakou wrote:
@ProgrammingFreak: What's Snap? I can't say I've heard of it.
Really? I think you would enjoy it.
It's an online version of Scratch that Jens and bharvey are developing.
Check it out here. Hope you enjoy. I've only played with it a little.
Last edited by ProgrammingFreak (2012-02-27 16:59:35)
Offline
wmays wrote:
Just wondering, but is it possible to define methods like for? Sort of like this...
Code:
repeat(10) { //code to be executed }Is there a way to define the repeat(){} method? I'm making a library for scratch users who want to learn java... it will be like Scratch (sorta).
I'm thinking this kind of code? (I'm still learning )
static void repeat(int num) { for (int i = 0; i < num; i++) { } }
Offline