Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » Obscure - The brand-new, Turing-Complete, easy to use programming language
- SuperSonicmario
- Scratcher
100+ posts
Obscure - The brand-new, Turing-Complete, easy to use programming language
It's a Mandelbrot fractal. It's generated by interpreting the coordinates of each pixel as a complex number, where the X position is the real part and the Y position is the imaginary part. This number is squared, then the original coordinates are added back in a loop. The colour of each pixel depends on how quickly the number increases. very impressive! good work. what exactly is it?
Update: Ugh. ChatGPT ninja'd me.
Last edited by SuperSonicmario (Oct. 19, 2024 08:30:19)
- endyourenite
- Scratcher
100+ posts
Obscure - The brand-new, Turing-Complete, easy to use programming language
B
U P
M
U P
M
- endyourenite
- Scratcher
100+ posts
Obscure - The brand-new, Turing-Complete, easy to use programming language
Lucky Match (Numbers)
Instructions: Guess correctly by putting in a random number of 1 to 7. Try to get the highest rounds as possible.
clear
out ...
out ...
out Lucky Match
set health to 3
set rounds to 0
out health: {health}
delay 3
while {health} > 0
ask Choose the number as PN
random 1 7 as BN
add {rounds} 1 as rounds
if {BN} = {PN}
out Correct
delay 2
add {health} 1 as health
out health: {health}
end
if {BN} != {PN}
out unlucky...the answer is {BN}...
delay 2
subtract {health} 1 as health
out health: {health}
end
end
if {health} < 1
clear
out you lost
out rounds: {rounds}
end
- Catzcute4
- Scratcher
500+ posts
Obscure - The brand-new, Turing-Complete, easy to use programming language
what incidentI am not touching “glitch” again after… let's just say…
Try it out: https://obscure.glitch.me/
I want to see what fun stuff y'all come up with
Obscure is a brand new programming language that I created
It's currently still in development, but works for the most part
To try it out:
1. Enter the website, you will see 3 sample projects
2. Open any project or create a new one to try it out
3. In the editor, you can click “Run” to run the project
4. You can also hit “Save” to save it, every project is stored
in your browser and will be there when you enter the page again
5. The full guide that shows all functions & their explanation is
on the navigation bar, called the Documentation
Please share on this topic any fun games or apps you make!
T H E I N C I D E N T
Last edited by Catzcute4 (Nov. 8, 2024 22:26:58)
- Voxalice
- Scratcher
500+ posts
Obscure - The brand-new, Turing-Complete, easy to use programming language
I made this like two months ago then forgot to finish it. Feel free to use it for whatever.
# Debug mode
set debug to 1
# Constants
set s to ·
set w to █
set p to 8
set error to OK
set screen_width to 18
set screen_height to 5
set default_x to 2
set default_y to 4
# Objects
set sign to ?
set note to #
set move to |
set str_hi to Welcome!
# Object format: {NAME} X Y DATA ROOM
array {w} 4 5 - 1 {w} 4 4 - 1 {w} 4 3 - 1 {w} 4 2 - 1 {note} 2 2 {str_hi} 1 {move} 17 3 2 1 as objects
set all_objects to {length:objects}
divide {all_objects} 4 as all_objects
# Declarations of non-constants
set current_x to {default_x}
set current_y to {default_y}
set game_state to 0
set room to 1
ask Type ">" to learn how to play. as input
if {length:input} > 1
set l1 to {letter 1:input}
if {l1} = >
clear
out Loading...
date timestamp as ts
delay 0
set game_state to 1
end
end
function get_object
# Set {object_num} first
multiply {object_num} 5 as objn
set object_room to {objects:objn}
subtract {objn} 1 as objn
set object_data to {objects:objn}
subtract {objn} 1 as objn
set object_y to {objects:objn}
subtract {objn} 1 as objn
set object_x to {objects:objn}
subtract {objn} 1 as objn
set object_name to {objects:objn}
end
function error
# Set {error} first
set game_state to -1
out -
out ! ERROR: {error}
out ! Restart by clicking RUN, then type >>.
end
function wall
set wi to 0
while {wi} < {screen_width}
outl {w}
add 1 {wi} as wi
end
out {w}{w}
end
function render_space
set space to {s}
if {current_x} = {xi} and {current_y} = {screen_y}
set space to {p}
end
set object_num to 0
while {object_num} < {all_objects}
add 1 {object_num} as object_num
call get_object
if {object_x} = {xi} and {object_y} = {screen_y} and {object_room} = {room}
if {space} = {p}
# Player is currently on top of an object
if {object_name} = {sign}
set extra_text to The sign reads "{object_data}"
end
if {object_name} = {note}
set extra_text to The note on the ground says "{object_data}"
end
if {object_name} = {w}
set error to The player is in a wall.
end
end
set space to {object_name}
end
end
if {current_x} = {xi} and {current_y} = {screen_y}
set space to {p}
end
outl {space}
add 1 {xi} as xi
end
function render
# Set {ts} first
date timestamp as ts2
subtract {ts2} {ts} as load_time
divide {load_time} 1000 as load_time
set extra_text to Loaded in {load_time} seconds
clear
set screen_y to {screen_height}
if {debug} = 1
out DEBUG MODE ENABLED! Input >room> to go to a room
out : X {current_x}, Y {current_y}
end
# Better Call Wall
call wall
while {screen_y} > 0
outl {w}
set xi to 1
while {xi} < {screen_width}
call render_space
end
call render_space
if {debug} = 1
out {w} - y {screen_y}
end
if {debug} != 1
out {w}
end
subtract {screen_y} 1 as screen_y
end
call wall
out ⠀
out : {input}
out : {extra_text}
if {error} != OK
call error
end
end
set input_length to {length:input}
subtract {input_length} 1 as input_length
if {input} = >room> and {debug} = 1
ask Room number? as room
end
set i to 0
while {i} < {input_length} and {game_state} > 0
# This loop handles all input, then calls render
add {i} 1 as i
set current_input to {letter i:input}
set direction to 0
if {current_input} = W and {current_y} < {screen_height}
set direction to up
add 1 {current_y} as current_y
end
if {current_input} = A and {current_x} > 1
set direction to left
subtract {current_x} 1 as current_x
end
if {current_input} = S and {current_y} > 1
set direction to down
subtract {current_y} 1 as current_y
end
if {current_input} = D and {current_x} < {screen_width}
set direction to right
add 1 {current_x} as current_x
end
set object_num to 0
while {object_num} < {all_objects}
add 1 {object_num} as object_num
call get_object
if {object_x} = {current_x} and {object_y} = {current_y} and {object_room} = {room}
# Player has walked over an object
if {object_name} = {w}
if {direction} = up
subtract {current_y} 1 as current_y
end
if {direction} = left
add 1 {current_x} as current_x
end
if {direction} = down
add 1 {current_y} as current_y
end
if {direction} = right
subtract {current_x} 1 as current_x
end
end
if {object_name} = {move}
set room to {object_data}
end
end
end
if {i} = {input_length}
call render
end
end
if {game_state} = 0
clear
out This is a top-down movement-based game. The player is represented by {p}.
out ⠀
out You begin by inputting >>. Each time you press RUN, you should add one letter in-between the >'s.
out The letters W, A, S, and D move the player up, left, down, and right respectively.
out ⠀
out ---
out ⠀
out For example:
out ⠀
out {w}{w}{w}{w}{w}
out {w}{s}{s}{s}{w}
out {w}{s}{p}{s}{w}
out {w}{w}{w}{w}{w}
out (input: >>)
out ⠀
out {w}{w}{w}{w}{w}
out {w}{s}{p}{s}{w}
out {w}{s}{s}{s}{w}
out {w}{w}{w}{w}{w}
out (input: >W>)
out ⠀
out {w}{w}{w}{w}{w}
out {w}{p}{s}{s}{w}
out {w}{s}{s}{s}{w}
out {w}{w}{w}{w}{w}
out (input: >WA>)
out ⠀
out ---
out ⠀
out To start playing, press RUN and input >>.
end
# - Changelog -
# started v0.2 on 2024-09-08
# 0.2 - rooms
- Discussion Forums
- » Advanced Topics
- » Obscure - The brand-new, Turing-Complete, easy to use programming language