Skip to content

Instantly share code, notes, and snippets.

View ringodin's full-sized avatar

Ringotron5000 ringodin

View GitHub Profile
@ringodin
ringodin / python bball drills, for loop and variable
Created January 19, 2021 03:12
This shows you how to use python to create a for loop with an increasing variable.
# -------------------------------------------------------------
#
# This uses a for loop to loop 4 times.
# it has a variable that adds 400 to itself every
# time through the loop.
#
#
# -------------------------------------------------------------
# Library imports
@ringodin
ringodin / Lists added in for pieces, Connect 4
Created January 18, 2021 13:06
This keeps track of which piece is placed where via some lists shown in the shell. The pieces are not drawn yet.
from pyglet import app
from pyglet import clock
from pyglet import graphics
from pyglet import gl
from pyglet import text
from pyglet.window import Window
from pyglet.window import mouse
from pyglet.window import key
from math import sin, cos, pi
@ringodin
ringodin / Arm move up on V5 Clawbot
Last active January 13, 2021 03:16
This brings an arm up and holds it there on VEX V5 clawbot.
// Configuration: V5 Clawbot (Drivetrain 2-motor, No Gyro)
// Claw Motor in Port 3
// Arm Motor in Port 8
//
// ----------------------------------------------------------------------------
// Include the V5 Library
#include "vex.h"
// Allows for easier use of the VEX Library
@ringodin
ringodin / one drawn square
Created January 11, 2021 03:34
for a square
from pyglet import app
from pyglet.window import Window
from pyglet.window import key
from pyglet import graphics
from pyglet import image
window = Window(600, 600)
@window.event
@ringodin
ringodin / printing random number in C++
Created January 2, 2021 07:22
This allows you to print a random number between 10 and 50.
#include "vex.h"
using namespace vex;
int z = rand();
// Begin project code
int main() {
Brain.Screen.newLine();
@ringodin
ringodin / Draw one piece in Connect 4, Dec 2020
Created December 15, 2020 07:08
This draws one piece at place of your choice. Adjust size, location, and and shape, and color as needed.
from pyglet import app
from pyglet import clock
from pyglet import graphics
from pyglet import gl
from pyglet import text
from pyglet.window import Window
from pyglet.window import mouse
from pyglet.window import key
from math import sin, cos, pi
@ringodin
ringodin / Grid lines drawn, Connect 4
Created December 15, 2020 01:17
This shows a big Grid drawn for a connect 4 Game.
from pyglet import app
from pyglet import clock
from pyglet import graphics
from pyglet import gl
from pyglet import text
from pyglet.window import Window
from pyglet.window import mouse
from pyglet.window import key
from math import sin, cos, pi
from pyglet import app
from pyglet import gl
from pyglet import clock
from pyglet.window import Window
from pyglet.window import key
from pyglet import graphics
from pyglet import image
from pyglet import text
from random import randint
import sys
@ringodin
ringodin / tail growing snake
Created December 2, 2020 13:22
This code allows the snake to append his tail and make it longer. However, he can still go through his own tail without death.
from pyglet import app
from pyglet import gl
from pyglet import clock
from pyglet.window import Window
from pyglet.window import key
from pyglet import graphics
from pyglet import image
from pyglet import text
from random import randint
import sys
@ringodin
ringodin / food eating snake, scores and yummy
Created December 2, 2020 07:02
This version of snake game can eat food, keep score, and say "yummy" each time it eats. Then more food appears.
from pyglet import app
from pyglet import gl
from pyglet import clock
from pyglet.window import Window
from pyglet.window import key
from pyglet import graphics
from pyglet import image
from pyglet import text
from random import randint
import sys