Skip to content

Instantly share code, notes, and snippets.

View Ryan-Amaral's full-sized avatar
🤡
Just clowning around

Ryan Amaral Ryan-Amaral

🤡
Just clowning around
View GitHub Profile
@Ryan-Amaral
Ryan-Amaral / generator.c
Created September 12, 2019 01:01
Generate a bunch of random numbers to print to std out.
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
//https://www.programmingsimplified.com/c-program-generate-random-numbers
int main(){
int numbers = 9001; // number of numbers to print
printf("Printing %d numbers!", numbers);
@Ryan-Amaral
Ryan-Amaral / duhast.c
Last active September 12, 2019 00:42
Generate the lyrics to Du Hast by Rammstein (WIP). Just the intro, but I wouldn't be against doing the full song in the future. This could be a fun challenge to make a concise elegant program to generate the lyrics.
#include <stdio.h>
int main(){
int i; // iterator
// initial chorus
for(i = 0; i < 19; i++){
printf("Du");
if(i % 3 == 1 || i % 3 == 2 || i > 12){
printf(" hast");
@Ryan-Amaral
Ryan-Amaral / simple.c
Last active September 10, 2019 21:19
A simple demo for capturing and displaying a character in c.
#include <stdio.h>
int main(){
char ch;
printf("Enter a character: ");
ch = getchar();
printf("Pointless line here, delete it! (dd)");
printf("Your character is: ");
@Ryan-Amaral
Ryan-Amaral / obsDict2List.py
Created August 7, 2019 17:16
obsDict2List - NeurIPS 2019: Learn to Move - Walk Around
def obsDict2List(oldObs):
newObs = []
for l1 in oldObs['v_tgt_field']:
for l2 in l1:
newObs.extend(l2)
newObs.append(oldObs['pelvis']['height'])
newObs.append(oldObs['pelvis']['pitch'])
newObs.append(oldObs['pelvis']['roll'])
newObs.extend(oldObs['pelvis']['vel'])