Discuss Scratch

MegaEliteCoder
Scratcher
100+ posts

Share your programs for cycle script

I made a programming language called cycle script https://scratch.mit.edu/projects/727820227/

You can share your programs here by using the export button and then copying the code
MegaEliteCoder
Scratcher
100+ posts

Share your programs for cycle script

#collatzconjecture↵n=input(“Enter n”)↵Warp↵While(not(comp(n,=,1)))↵calc = comp(div(n,2),=,round(div(n,2)))↵If(calc)↵N = div(n,2)↵End↵If(not(calc))↵N = add(mul(n,3),1)↵End↵Print(n)↵End↵End↵
Seon8
Scratcher
33 posts

Share your programs for cycle script

loops = input(“Loops?”)↵i = 0↵n = 2↵While(comp(i, <, loops))↵n = mul(n, n)↵i = add(i,1)↵Print(n)↵End↵
Squares itself…

- Seon8

This is a forum signature, where people explain forum signatures!

I follow most of the topics I post in. You can respond with another post or a comment on my profile.

Check out my profile!
MegaEliteCoder
Scratcher
100+ posts

Share your programs for cycle script

Seon8 wrote:

loops = input(“Loops?”)↵i = 0↵n = 2↵While(comp(i, <, loops))↵n = mul(n, n)↵i = add(i,1)↵Print(n)↵End↵
Squares itself…
cool!
Seon8
Scratcher
33 posts

Share your programs for cycle script

#guessing game↵number = 41↵guess = input(“Guess a number 1-100”)↵While(not(comp(guess, =, number)))↵If(comp(guess, <, number))↵print(“Too low!”)↵else↵print(“Too high!”)↵End↵guess = input(“Guess again!”)↵End↵End↵print(“You guessed it!”)↵
“You guessed it!” pops up randomly some times but works besides that. Number isn't actually random because I don't think that command exists… didn't know you could use “rand(min, max)”

Last edited by Seon8 (Sept. 5, 2022 12:42:37)


- Seon8

This is a forum signature, where people explain forum signatures!

I follow most of the topics I post in. You can respond with another post or a comment on my profile.

Check out my profile!
MegaEliteCoder
Scratcher
100+ posts

Share your programs for cycle script

Seon8 wrote:

#guessing game↵number = 41↵guess = input(“Guess a number 1-100”)↵While(not(comp(guess, =, number)))↵If(comp(guess, <, number))↵print(“Too low!”)↵else↵print(“Too high!”)↵End↵guess = input(“Guess again!”)↵End↵End↵print(“You guessed it!”)↵
“You guessed it!” pops up randomly some times but works besides that. Number isn't actually random because I don't think that command exists…

Rand(min,max)
Lol it has random nums
MegaEliteCoder
Scratcher
100+ posts

Share your programs for cycle script

Seon8 wrote:

#guessing game↵number = 41↵guess = input(“Guess a number 1-100”)↵While(not(comp(guess, =, number)))↵If(comp(guess, <, number))↵print(“Too low!”)↵else↵print(“Too high!”)↵End↵guess = input(“Guess again!”)↵End↵End↵print(“You guessed it!”)↵
“You guessed it!” pops up randomly some times but works besides that. Number isn't actually random because I don't think that command exists…

Weird I’ll have to debug that it shouldn’t pop up
Seon8
Scratcher
33 posts

Share your programs for cycle script

#guessing game↵number = rand(1,100)↵guess = input(“Guess a number 1-100”)↵While(not(comp(guess, =, number)))↵If(comp(guess, <, number))↵print(“Too low!”)↵else↵print(“Too high!”)↵End↵guess = input(“Guess again!”)↵End↵print(“You guessed it!”)↵
Added actual random numbers. Still prints that you guessed when you haven't sometimes but doesn't stop the code…

Last edited by Seon8 (Sept. 5, 2022 13:31:57)


- Seon8

This is a forum signature, where people explain forum signatures!

I follow most of the topics I post in. You can respond with another post or a comment on my profile.

Check out my profile!
MegaEliteCoder
Scratcher
100+ posts

Share your programs for cycle script

Seon8 wrote:

#guessing game↵number = rand(1,100)↵guess = input(“Guess a number 1-100”)↵While(not(comp(guess, =, number)))↵If(comp(guess, <, number))↵print(“Too low!”)↵else↵print(“Too high!”)↵End↵guess = input(“Guess again!”)↵End↵print(“You guessed it!”)↵
Added actual random numbers. Still prints that you guessed when you haven't sometimes but doesn't stop the code…
I’ll debug that
MegaEliteCoder
Scratcher
100+ posts

Share your programs for cycle script

Seon8 wrote:

#guessing game↵number = rand(1,100)↵guess = input(“Guess a number 1-100”)↵While(not(comp(guess, =, number)))↵If(comp(guess, <, number))↵print(“Too low!”)↵else↵print(“Too high!”)↵End↵guess = input(“Guess again!”)↵End↵print(“You guessed it!”)↵
Added actual random numbers. Still prints that you guessed when you haven't sometimes but doesn't stop the code…

I fixed it.. I spent an hour looking debugging and I only had to change 2 blocks \:
2rare4you
Scratcher
1 post

Share your programs for cycle script

#fast growing number↵number = add(10, 9e-16)↵While(comp(3, =, 3))↵print(number)↵number = mul(number, div(number, 10))↵End↵print(“You guessed it!”)↵

thing that can actually square itself and then divide by 10

Powered by DjangoBB