Writing a Simple terminal based Dice Game in Python

Last week, We were given a task and that was to show a project (Game, app or script), where we had to use tools that we have learned so far.

I was busy this weekend shifting my hostel and I forgot to complete the task. So I decided to write a simple Dice Game.

Coming to the code of the game. This is a terminal based game without using any graphics. You will roll a die and If Six comes, You will win the Game :). I used random module to generate random numbers. When user will roll the die, randit function generates a random number between 1,6. You will have a better luck if you get a Six.

Since writing code was not only part of the task, but to use tools taught during the session. So I used following tools for my development

  • Vim – Code Editor
  • Git
  • Github
  • Markdown
  • Python

I created Python Small Projects repo on GitHub and pushed code there.

I will write more scripts or silly games to that repo as I am practicing Python these days. I will also add python scripts, that I wrote a few days back and already using.

Please Look at Code and Repo and If find error and improvement, Create and Send a pull request.

Github Repo Link: https://github.com/iKshitiz/Python_Small_Projects

Who are hackers and What is Hacking ?

I was reading “Free as in Freedom” suggested by Kushal on the #dgplug channel on IRC. We also had a session on “History of Free Software Movement” on Monday”. I bookmarked the page at that time and thought to give a read in free time.

After reading the book, I was surprised and disgraced at the same time that we have no knowledge of the history of this computer science world and even we never tried to know.

So,  I will start with short Introduction of the book. This book is “biographical snapshots of GNU project founder Richard Stallman with the political, social and economic history of the free software movement. This book examines one man’s 20-year attempt to codify and communicate the ethics of 1970s era “hacking” culture in such a way that later generations might easily share and build upon the knowledge of their computing forebears. The book documents Stallman’s personal evolution from teenage misfit to the prescient adult hacker to political leader and examines how that evolution has shaped the free software movement. ”

‘Hacker’, Whenever we read or find out this term, the image that comes to our head is “a person who secretly gets access to a computer system in order to get information, cause damage”. This is what we use to see in movies or media. This is definition by most of the dictionary we follow. But that’s not the fact.

According to Richard Stallman hack means “Playful cleverness.” Hacking meant playful brilliance.

Hackers amaze people with their intelligence and innovation. They gave life to novel ideas which people thought were impossible to do; to wrought into reality.

To understand the meaning of the word “hacker,” and to understand the hacker ethic culture, one should read this book.

This book beautifully explains how the terms cracking’,security breaking’ and prank’ mixed up and create a misunderstanding.  How the word ‘Hacking’ got the new definition as the time changed. That’s why writer of the book finished his writing with these lines

Using the term “cracking” rather than “hacking,” when you mean “security breaking,” shows respect for Stallman and all the hackers and helps preserve something which all computer users have benefited from: the hacker spirit.

After reading the book I can say “I am proud to be a hacker”


  1. Kushal Das’s Article on “Hacker Ethic and Free software movement”
  2. Free as in Freedom

Free software movement & Hacker culture

I will start this post with a quote by Kushal Das in between the session yesterday.

“The history is important, Learn about it!”

We had a session on IRC channel dgplug last night and the topic was “History of hacking and free software movement”.

The session started with this simple recent tweet by Gnome and a few replies

In this session, Kushal gave an inspiring talk on this topic, He told us about

  • TX-O computer at MIT lab,
  • How ‘Hacker Ethic’ word came into existence
  • The rise of Free Software Movement.
  • PDP – I computer
  • Richard Stallman
  • Founding FSF
  • Launching GNU
  • Open Source Initiative (OSI) by Bruce Perens and Eric S. Raymond.

Whenever we use Linux, or an open source software, Everything that we see today in Open source world, It all started with Free Software movement, which is about the freedom of users.

He also suggested us some books and resources to read about “History of hacking and free software movement”

  1. Free as in Freedom
  2. Hackers: Heroes of Computer Revolution
  3. A documentary “Revolution OS”

You can check IRC logs of dgplug here.

Dotfiles: Customize your system

I heard this term first during dgplug Summer training in 2016 when sayan was taking a class on vim. Currently, I am setting up all of my dotfiles for a Fedora configuration. (Read more about Fedora here )

What are dotfiles?

Dotfiles are plain text configuration files on Unix-like systems for things like our shell in.bash_profile,  our editor in .vimrc,.gitignore,  and many others. They are called “dotfiles” as they typically are named with a leading . making them hidden files on your system.

Why Dotfiles?

Dotfiles are used to customize your system. these are not regular documents, and by default are hidden in directory listings.

Dotfiles basically contain the preferred setup of your computer. They usually come with a setup procedure so you can easily install everything again when you need to start from a fresh system. dotfiles also really useful for syncing preferences across multiple devices.

Configuration for my Fedora machine

I set up dotfiles for my vim configuration, bash profile and git configuration, these are the tools(packages) that I use regularly. I am currently using limited data package of Airtel prepaid connection, which is too costly to afford.  I will upload all my dotfiles to GitHub repository next month when I will have a broadband connection.