You are not logged in or registered. Please login or register to use the full functionality of this board...
SIGN IN Join Our Community For FREE


code in a kit
06-22-2017, 03:38 AM (This post was last modified: 06-22-2017 12:42 PM by figosdev.)
Post: #1
 (Print Post)
code in a kit
so this is an idea that i think is worth trying, but theres no actual *need* for it; youre letting someone do something that could be done for them.

"code in a kit" is computer code thats "packaged" in a text file, in small pieces. to "put the pieces together," the user takes these pieces out of the file using copy or cut, and pastes them where they go.

its kind of like building a model airplane.

the person doesnt have to know how to write code, they only need to put the pieces correctly in place. they can learn about each piece (unless they skip that part) be reading the area above that piece.

what happens if they just run the code "out of the box?" nothing, because it wont be put together that way. the point is to learn how to put it together.

why not a tutorial instead?

tutorials are great. perhaps you could have a tutorial in a kit too--

"put together your own tutorial... just copy these pieces..."

i have said that cheat sheets are like a lightsaber for coders; you need one when youre learning, and as you learn more, you are inclined to build your own.

whats the best kit to put together like a model airplane? a programming language! you could learn about each part as you put it together, you could even customise it by choosing the parts you want.

video game, browser-- and even subroutines.

like some models let you build a car, others let you build an engine. so you could have kits at different scales.

id like to do a book on programming with this approach. "over 25 programs to build!"

could be a fantastic app.




Code Snippet: [Select]
# draw a circle one dot at a time
## 2017 mn
## license: creative commons cc0 1.0 (public domain)
## http://creativecommons.org/publicdomain/zero/1.0/


# replace with part 1
#
#

# replace with part 2

    # replace with part 4
    #

    # replace with part 5
    #  

    # replace with part 6
    # replace with part 7

    # replace with part 3


# [ part 1 ]
# sets the radius,
# horizontal location of the circle (cx)
# and vertical location of the circle (cy)

r = 250
cx = 350
cy = 300


# [ part 2 ]
# starts a numeric loop that begins at -3.14
# and finishes at 3.14, adding 1/r on each repeat

for p = -3.14 to 3.14 step 1/r


# [ part 3 ]
# closes the loop
# all code between parts 2 and 3 repeats

next


# [ part 4 ]
# calculate the x of one dot
# get the cosine of p, times circle radius
# round down to the nearest whole number, add cx

x = cos(p) * r
x = int(x) + cx


# [ part 5 ]
# calculate the y of one dot
# get the sine of p, times circle radius
# round down to the nearest whole number, add cy

y = sin(p) * r '5
y = int(y) + cy


# [ part 6 ]
# draw a dot at x, y

pset (x,y)


# [ part 7 ] optional!
# wait between each dot so the circle draws slowly

sound 32767, .01
Find all posts by this user
Like Post



Forum Jump:


User(s) browsing this thread: 1 Guest(s)




QB64 Member Project - Domain
QB64 Member Project - Sabotage
QB64 Member Project - Bowditch curve
QB64 Member Project - Martin Fractals version two
QB64 Member Project - ARB Checkers
QB64 Member Project - Othello
QB64 Member Project - Pivet version one
QB64 Member Project - Overboard
QB64 Member Project - Amazon
QB64 Member Project - Blokus
QB64 Member Project - Exit
QB64 Member Project - Kings Court
QB64 Member Project - Quarto
QB64 Member Project - Pivot version two
QB64 Member Project - Spinning Color Wheel
QB64 Member Project - Martin Fractals version one
QB64 Member Project - Martin Fractals version three
QB64 Member Project - Color Triangles
QB64 Member Project - Score 4
QB64 Member Project - Splatter
QB64 Member Project - Red Scrolling LED Sign
QB64 Member Project - Dreamy Clock
QB64 Member Project - Input
QB64 Member Project - 9 Board
QB64 Member Project - Basic Dithering
QB64 Member Project - Full Color LED Sign
QB64 Member Project - OpenGL Triangles
QB64 Member Project - Point Blank
QB64 Member Project - Line Thickness
QB64 Member Project - Dakapo
QB64 Member Project - Connect Four
QB64 Member Project - Martin Fractals version four
QB64 Member Project - STxAxTIC 3D World
QB64 Member Project - Kings Valley verion one
QB64 Member Project - MAPTRIANGLE
QB64 Member Project - Spiro Roses
QB64 Member Project - Kings Vallery version two
QB64 Member Project - Algeria Weather
QB64 Member Project - Qubic
QB64 Member Project - Kobolts Monopoly
QB64 Member Project - Color Rotating Text
QB64 Member Project - Rubix's Magic
QB64 Member Project - RGB Color Wheel
QB64 Member Project - Swirl
QB64 Member Project - Rotating Background
QB64 Member Project - Inside Moves
QB64 Member Project - Foursight
QB64 Member Project - Touche
QB64 Member Project - Isolation