Skip to content

Instantly share code, notes, and snippets.

Avatar

Johanne Andersen JohanneA

  • Kambr
  • Amsterdam
View GitHub Profile
@JohanneA
JohanneA / dynamic-stack.c
Last active Apr 26, 2018
A dynamic stack data structure made in C
View dynamic-stack.c
#include <stdlib.h>
#include <stdio.h>
#define DEFAULT_SIZE 16
int no_of_words = 0; //Number of elements in array
int array_size = DEFAULT_SIZE;
int *stack; //Stack pointer
void init_stack() {
stack = malloc(sizeof(uint32_t) * DEFAULT_SIZE);
@JohanneA
JohanneA / number_guessing_game.rb
Created Sep 20, 2019
A number guessing game in ruby, built during the Girl Code Amsterdam Meetup on the 18. September 2019
View number_guessing_game.rb
def play_game(start_range, end_range)
computer_guess = rand(start_range..end_range)
user_guesses = []
puts "Guess a number"
user_guess = gets.chomp.to_i
while user_guess != computer_guess
if user_guesses.include?(user_guess)