Discuss Scratch

marsmark
Scratcher
84 posts

Scratch++ | A text based Programming Language made in Scratch

DimensionalGuard53 wrote:

marsmark wrote:

It's just that I have no knowledge on frontend stuff. Might be a good update once I learned something related.

I know a lot about it and I can summarize it.
ASCII is the standard text & text rendering scheme for all computers and keyboards, there's 3 categories that are self explanatory.
  • Printable: These are the characters you see and can generally use
  • Control: These control how it's rendered but that is unrelated to this
  • Extended: These are the ones I'm talking about, they aren't generally used but are easily accessible on many older computers.

Here's a table of all of them, no need to add all of them, just the ones that look like graphics (like characters 200-206)

I counted all the ones that look like graphics already, there's 22. And I think to access them it could be a simple tab somewhere that allows it. Like you've might've seen I know what it's like so once again, I'm not pressuring at all. If you need info I'll be happy to give it!
I thought you mean something like HTML that shows an actual GUI like Scratch does, but if it's just text stuff, I may be able to look up how it works and add it.

Last edited by marsmark (Nov. 17, 2022 03:03:40)

DimensionalGuard53
Scratcher
4 posts

Scratch++ | A text based Programming Language made in Scratch

marsmark wrote:

I thought you mean something like HTML that shows an actual GUI like Scratch does, but if it's just text stuff, I may be able to look up how it works and add it.

As I said, take your time, no need to rush it.

Last edited by DimensionalGuard53 (Nov. 17, 2022 20:46:08)

marsmark
Scratcher
84 posts

Scratch++ | A text based Programming Language made in Scratch

Another small update (v1.0.23b):
I just added “else if” statement, not much of a change here, currently trying to optimize the the project and increase performance. Anyway, here's the example code.
if (3 == 2) {
set statement to 1
} else if (2 >= 3) {
set statement to 2
} else if (4 == 4) {
set statement to 3
} else {
set statement to 4
}
For deeper illustration on how to use the statement, check out the original thread.

Last edited by marsmark (Nov. 18, 2022 02:59:56)

HuntwithCannons
Scratcher
4 posts

Scratch++ | A text based Programming Language made in Scratch

wait could you make it have some kind of thing where it shows things you cold type like in many programing languages, because rightnow if I misspell anything it does not work
marsmark
Scratcher
84 posts

Scratch++ | A text based Programming Language made in Scratch

HuntwithCannons wrote:

wait could you make it have some kind of thing where it shows things you cold type like in many programing languages, because rightnow if I misspell anything it does not work
It was possible, however, performance wise, I don't want it to be any slower.

Last edited by marsmark (Nov. 22, 2022 07:37:59)

marsmark
Scratcher
84 posts

Scratch++ | A text based Programming Language made in Scratch

Another small update (v1.0.24b):

As requested, I added replace() in-built method; it was a hard one to implement. It was the first 3 parameters method function that I added, here's how replace() works; every second input of the first input will be replaced by the third input.
set ret_var to replace(“heaao there, my name is eaaa, aaol”, “aa”, “lll”)
the result: “helllo there, my name is ellla lllol”

Feel free to mess around with this one

Last edited by marsmark (Nov. 24, 2022 08:08:39)

marsmark
Scratcher
84 posts

Scratch++ | A text based Programming Language made in Scratch

Nov 25, 2022 - v1.1.25b Major Update

+ Added arrays/lists.
[ 1, 3, 30 ] #This is the syntax for the list/array, use two [ ] to write an array. (does not support list inside list)
+ add( <value1>, <value2> )
set array to add( [ -3, 23, 4 ] , 5) #Add value1 of any value type to value2 of any value type and return a value of an array type.
+ item( <int/double>, <array> )
set value to item( 0 , [ “Hello”, “world”, “meme” ] ) #Get the value of second input array located at first input value index. Every array starts at index 0.
+ head( <array> )
set value to head( [ 6, 7, -9 ] ) #Get the value of the input array located at first index.
+ tail( <array> )
set value to tail( [ true, false, true ] ) #Get the value of the input array located at last index.
+ length( <array> )
set array_size to length( [ 59, 75, 38 ] ) #Get the size of the array.

Last edited by marsmark (Dec. 12, 2022 18:43:36)

lucid_shadow913
New Scratcher
1 post

Scratch++ | A text based Programming Language made in Scratch

good project!
marsmark
Scratcher
84 posts

Scratch++ | A text based Programming Language made in Scratch

lucid_shadow913 wrote:

good project!
Thank you!
Randoblackkid
Scratcher
1 post

Scratch++ | A text based Programming Language made in Scratch

when I receive [ lol]
if <milk> then
say [awsome]

end

just testing scratch blocks lol

Last edited by Randoblackkid (Dec. 20, 2022 01:36:20)

marsmark
Scratcher
84 posts

Scratch++ | A text based Programming Language made in Scratch

Bump!
brrp
Scratcher
77 posts

Scratch++ | A text based Programming Language made in Scratch

is there any way to do a
try{
/*some code you'll execute"/
return True;
}

catch{
return False;
}
and also a returnable value for a function?
define addition (equation){
return eval( equation);
}

maybe a manual garbage collection system too?

if (1 == 1){
delete myvariable;
}

if myvariable.exists(){
myvariable ++;
}
else{
myvariable = 0;
}

also dictionaries?

define thisthing (request){
var mydictionary = {
“hello”:“a greeting”,
“bye”:“a word”
}
try{
return mydictionary{request};
}
except{
return 0;
}
}
really solid project though!

Last edited by brrp (Jan. 17, 2023 04:42:12)

marsmark
Scratcher
84 posts

Scratch++ | A text based Programming Language made in Scratch

brrp wrote:

is there any way to do a
try{
/*some code you'll execute"/
return True;
}

catch{
return False;
}
and also a returnable value for a function?
define addition (equation){
return eval( equation);
}

maybe a manual garbage collection system too?

if (1 == 1){
delete myvariable;
}

if myvariable.exists(){
myvariable ++;
}
else{
myvariable = 0;
}

also dictionaries?

define thisthing (request){
var mydictionary = {
“hello”:“a greeting”,
“bye”:“a word”
}
try{
return mydictionary{request};
}
except{
return 0;
}
}
really solid project though!

I'll add it in future projects, those are really great ideas!
smarthoneybadger
Scratcher
30 posts

Scratch++ | A text based Programming Language made in Scratch

It would be cool if someone turned this into a website.
nono_scratcheur
Scratcher
32 posts

Scratch++ | A text based Programming Language made in Scratch

INCREDIBLE BRO
MonkeyBean2
Scratcher
500+ posts

Scratch++ | A text based Programming Language made in Scratch

I think I have found a bug.

define xx(i) {
if (i > 0){
xx(i-1)
print i
}
}

xx(20)

This code should print out the following:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
But it just lags the page and outputs nothing.

export code:
main.scr/define xx(i){§  if (i > 0){§    xx(i-1)§    print i§  }§}§xx(20)§
MonkeyBean2
Scratcher
500+ posts

Scratch++ | A text based Programming Language made in Scratch

marsmark wrote:

DimensionalGuard53 wrote:

marsmark wrote:

DimensionalGuard53 wrote:

I have a simple question: Has tech just, restarted at square one at this point?
what do you mean?
I mean, from what I can tell. Scratch++ is text only, just like the early days of programing (Like on the Commadore PET). And back then to get anything close to graphics you had to use text characters. I'm not saying add more graphics though, I'm just pointing out the similarities.

some ASCII characters for minimal graphics would be nice though again, not pressuring you.
It's just that I have no knowledge on frontend stuff. Might be a good update once I learned something related.
You could easily add pen blocks
marsmark
Scratcher
84 posts

Scratch++ | A text based Programming Language made in Scratch

MonkeyBean2 wrote:

I think I have found a bug.

define xx(i) {
if (i > 0){
xx(i-1)
print i
}
}

xx(20)

This code should print out the following:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
But it just lags the page and outputs nothing.

export code:
main.scr/define xx(i){§  if (i > 0){§    xx(i-1)§    print i§  }§}§xx(20)§
Don't write recursions lol, I didn't implement stacks. All functionality can only be used once at a time (except for conditions)
MonkeyBean2
Scratcher
500+ posts

Scratch++ | A text based Programming Language made in Scratch

Hmm for some reason this isn't working… It should print out a mandelbrot image… But it just lags…

main.scr/set chars to "$@B%8&WM#*oahkbdpqwmZO0QLCJUYXzcvunxrjft/\|()1{}[]?-_+~<>i!lI;:,\"^`'."§set xb to 0§set yb to 0§§set j to 0§set re to 0.1*yb§set im to 0.1*xb§set reb to re§set imb to im§set i to 0§set shouldbreak to 0§repeat 20*20*50 {§  if ((j % 50) == 1) {§    set line to ""§§    set re to 0.1*yb§    set im to 0.1*xb§    set reb to re§    set imb to im§    set i to 0§    set shouldbreak to 0§  }§§  # loop 50§  if (shouldbreak == 1) {§  } else {§    set rec to re*re - im*im§    set imc to 2 * re * im§    set re to rec + reb§    set im to imc + imb§    if ((re*re + im*im) > 16) {§      set shouldbreak to 1§    }§    change i by 1§  }§§  if ((j % 50) == 0) {§    set line to join(line, letter(i/50.0*length(chars), chars))§§    set yb to yb+1§  }§§  if ((j % 50*20) == 0) {§    print line§    set xb to xb+1§  }§  set j to j + 1§}§

Last edited by MonkeyBean2 (Feb. 11, 2023 11:58:06)

MonkeyBean2
Scratcher
500+ posts

Scratch++ | A text based Programming Language made in Scratch

marsmark wrote:

MonkeyBean2 wrote:

I think I have found a bug.

define xx(i) {
if (i > 0){
xx(i-1)
print i
}
}

xx(20)

This code should print out the following:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
But it just lags the page and outputs nothing.

export code:
main.scr/define xx(i){§  if (i > 0){§    xx(i-1)§    print i§  }§}§xx(20)§
Don't write recursions lol, I didn't implement stacks. All functionality can only be used once at a time (except for conditions)
Well that's unfortunate I thought I could use recursion for while loop functionality…

Powered by DjangoBB