Python code

import random
import sys

def drawBoard(board):
#this function prints out the board that is passed. Returns none.
HLINE=’ +—+—+—+—+—+—+—+—+’
VLINE=’ | | | | | | | | |’

print (‘ 1 2 3 4 5 6 7 8 9’)
for y in range(8):
print(y+1, end=”)
for x in range(8):
print(‘| %s’ % (board[x][y]), end=”)

def resetBoard(board):
#Blanks out the board it is passed, except for the original starting position

for x in range(8):
for y in range(8):

#starting peices

def getNewBoard():
#creates a brand new, blank data structure

for i in range(8):
board.append([”] * 8)
return board

def isValidMove(board, tile, xstart, ystart):
# Returns False if the player’s move on space xstart, ystart is invalid.
# If it is a valid move, returns a list of spaces that would become the player’s if they made a move here.

if board[xstart][ystart] !=’ ‘ or not isOnBoard(xstart, ystart):
return False
board[xstart][ystart] = tile # temporarily set the tile on the board.
if tile == ‘X’:
otherTile = ‘O’
otherTile = ‘X’

for xdirection, ydirection in [[0, 1], [1, 1], [1, 0], [1, -1], [0, -1], [-1, -1], [-1, 0], [-1, 1]]:
x, y = xstart, ystart
x +=xdirection #first step in the direction
y +=ydirection #first step in the direction
if isOnBoard(x,y) and board[x][y] == otherTile:
#There is a peice belonging to the other player next to our piece

x +=xdirection
y +=ydirection
if not isOnBoard(x,y):
while board[x][y] == otherTile:
x +=xdirection
y += ydirection
if not isOnBoard(x,y): #break out of while loop , then continue in fro loop
if not isOnBoard(x,y):
if board[x][y] == tile:
#there are pieces to flip over. Go in the reverse direction untill we reach the original space, noting allthe tiles along the way
while True:
x -=xdirection
y -=ydirection
if x == xstart and y ==ystart :
board[xstart][ystart] =”#restore the empty space

if len(tilesToFlip)==0: #If no tiles were flipped , this is not a valid move.
return False
return tilesToFlip

def isOnBoard(x, y):
#retunrs True if the coordinates are located on the board
return x>=0 and x=0 and y bestScore:
bestMove = [x, y]
bestScore = score
return bestMove

def showPoints(playerTile, computerTile):
# Prints out the current score.
scores = getScoreOfBoard(mainBoard)
print(‘You have %s points. The computer has %s points.’ %(scores[playerTile], scores[computerTile]))

print(‘Welcome to Reversi!’)
while True:
# Reset the board and game.
mainBoard = getNewBoard()
playerTile, computerTile = enterPlayerTile()
showHints = False
turn = whoGoesFirst()
print(‘The ‘ + turn + ‘ will go first.’)
while True:
if turn == ‘player’:
# Player’s turn.
if showHints:
validMovesBoard = getBoardWithValidMoves(mainBoard, playerTile)
showPoints(playerTile, computerTile)
move = getPlayerMove(mainBoard, playerTile)
if move == ‘quit’:
print(‘Thanks for playing!’)
sys.exit() # terminate the program
elif move == ‘hints’:
showHints = not showHints
makeMove(mainBoard, playerTile, move[0], move[1])
if getValidMoves(mainBoard, computerTile) == []:
turn = ‘computer’
# Computer’s turn.
showPoints(playerTile, computerTile)
input(‘Press Enter to see the computer\’s move.’)
x, y = getComputerMove(mainBoard, computerTile)
makeMove(mainBoard, computerTile, x, y)
if getValidMoves(mainBoard, playerTile) == []:
turn = ‘player’
# Display the final score.
scores = getScoreOfBoard(mainBoard)
print(‘X scored %s points. O scored %s points.’ % (scores[‘X’], scores[‘O’]))
if scores[playerTile] > scores[computerTile]:
print(‘You beat the computer by %s points! Congratulations!’ % (scores[playerTile] – scores[computerTile]))
elif scores[playerTile] < scores[computerTile]:
print('You lost. The computer beat you by %s points.' % (scores[computerTile] – scores[playerTile]))
print('The game was a tie!')
if not playAgain():


I could see from the look of his eyes,
He watched to something distance,
Something ever coming,
This time I could see a glimpse of glitter in them,
A welcoming look to something I tried to see,
But couldn`t pick it out,
He turned and said,
“Son, do you see that?”
I tried but couldn`t see it yet,
“It`s finally here son all is well now”
From a far I could see a white rising smoke,

Words so deep, unsung,
Some deep quiet conviction,
Deep within,
Beneath the soul,
Always speaks that of the soul and heart,
So moving and motivating,
Pricking the reason for our existence,
And the marvel of everything,


Ben Stuff

Behold ,
He always stood,
For sometime now at a glance,
His face looked distance,
Buried in a deep unknown thoughts,
No one knew anything behind that look,
But rumour had it,
That he carried that which no man could,
Bestowed upon him was the burden of all and sundry,
But do we cry,
He beats his drum at the disposal of his hands,
He plays the guitar at the tenderness of his fingers,
Beating the dust out of her heart,
She who understands his clenching fists,
And swayed by his tunes,

View original post


Behold ,
He always stood,
For sometime now at a glance,
His face looked distance,
Buried in a deep unknown thoughts,
No one knew anything behind that look,
But rumour had it,
That he carried that which no man could,
Bestowed upon him was the burden of all and sundry,
But do we cry,
He beats his drum at the disposal of his hands,
He plays the guitar at the tenderness of his fingers,
Beating the dust out of her heart,
She who understands his clenching fists,
And swayed by his tunes,


We never lose composure,

In our hoods we don`t die of exposure,

We fight hard to escape from the torture,

In our hearts and feelings we`ve always been made low,

Not because of our wishes but because of the law,

But forward we will move,

From the little we will achieve,

We strike back as we reflect,

On the leaders we elect,

Before the sunset,

We rose and made ourselves ready and set,

We struggled though encountered and outwitted the challenges we met,

Though our clothes were made wet,

Forever we will move forward,

For success in our paths,

Break the shackle and be the next big thing

Our ultimate goal in life always revolve around making life better, having good family, owning some business ventures (wide range of investments) and all the goods that can be attained in life. We always read great books “How to succeed in life, Principles for a good life” and all those books in the bead to get right information to better our selves.
However, we; the youth have always been buried in some sort of cocoon that have prevented us from making it out and be what we want to be. Be what we`ve always have since time immemorial in our dreams. We always want to be better within a blink of a moment, we want to ankukia some thousands if not millions of cash from the blues and start investing big fortunes, buy some luxury cars, good house, etc, (Thanks to Sportpesa, elitebet and other betting sites for almost making this a reality though sometime at a cost).
Below are some of the reasons that have prevented us from making out to be better
Tied to the societal traditional norm.
The society has always had a belief. A believe that we have to follow a certain set of rules in order to succeed and every one in it have to be guided by it towards his/her goals. One has to have university degrees, masters, PhD’s, and all those big tittles to succeed in his/her life. I`m not saying, however, we should not go to school to earn all those titles. Some have succeeded but it is not a guarantee for everybody. We have accustomed to focusing on titles we would have rather than the reality of life we want to have; good life which titles often don`t bring to us.
Suli Breaks in his spoken word “SAY YES” said “you don`t have to go to University, if it is not for you”
So it is time we break this traditional societal norm. Find passion and follow it. Some of the great people we know of in the world did not complete their formal education, some in our backgrounds did not see the door to classroom yet they are successful in life.
I, you, them, us, we neglect the small things that matter. There is an event in town of entrepreneurship workshop where entrepreneurship skills would be taught. Who bothers to go? No one, it is only some few young men and women make it there. Contrary, same day, there is a function in the same town, a bash, a party, in some club. The capacity is unbelievable. We throng there in large numbers in contrast to the entrepreneurship forum. Partying is good. It is one way of enjoying life. But sometimes a balance between the comfort zones and a little effort in our struggles can do us much better given time because life begins at the end of that place you call comfort zone.
Fear of failure
We often fear to try something out new with the fear of the results. What if it fails, what if it turns out to be the opposite of my expectations, are all strings of thoughts that flows in our minds.
We have to try it anyway. Who would care of our results anywhere, it only matter to us . The sweetest part of life is breaking the shackles of fear. Try it, fail, learn from it, and try it again. In the end we would be joining the dots to form tunes humming together in perfect harmony with each other making us better.
Failing to implement the ideas we have
We always think we have to have mega brains, be geniuses to have valid ideas worth implementation. Build next Face book app, build an app that do wonders in the world. But let me tell you something; small ideas become big when we take a step to implement it. There is a story of Tom Osborn, a Kenyan who is the inventor of ‘green’ charcoal. He started his invention not knowing how big it would be. Erick Kinoti, founder and director of Shades Systems East Africa Limited started when he was selling eggs and somebody was looking for tents on hire. It is then that he realized that no one had, leading him towards his quest to coming up with the company.
The ideas we have are worth what it takes. They always lead us to something bigger than we imagined however small they initially are.
We don`t trust our struggles
We have at times been derailed by happenings in our lives, regrets have followed us, opportunities have slipped through our hands like sand grains, like water under the bridge never to be seen again. But at the end there is one thing that never fails us, our struggle.
The struggles we put in our daily lives always add up to something big someday ahead and putting trust in it will make who we wanted to be.

All the best as you set out to be better your life.

00111010 00101001 00100000

There are 10 kinds of people in this world,
and binary accounts for them all.

They’re happy and sad.
They’re ones and zeros.
Villains and heroes.
Villains, yet not all bad.
Despite everything life decides to hurl;
Despite every brick ball of fear
Through the stained glass windows of their minds,
Through it all, they survive.
They’re angry and glad.
They’re happy and sad.

And in their duality, they’re still smiling there
at your sharp hasty words
at your venomous hurt
that you wish so desperately they, too, shared.

Hello Poetry

RIP by Suli Breaks

To all the victims of the gun crime and the knife crime,
To them I say R.I.P.
But when I say R.I.P.
I dont just mean rest in peace,
I mean rewind it please,
So we can remain in peace,
I had to read it properly,
To get it right in perspective,
Coz you reside in poverty,
But dont want rights in property,
Youd rather rob innocent people,
Coz he gains respect in popping me,
That the real ignorant philosophy,
We need to reject its prophesy,
Stand up and R.I.P.
Rep it properly,
Coz rawr its peak,
Went from rice and peas,
To rifles in pockets,
ruining inner-state projects,
Raw its a par,
To its riots in parks,
Raw I pead,
Remember I plead,
The realness I preach,
We have reminders in present,
Why do you think the damenola taylor center R.I.P.
Remains in Peckham,
Rise in position,
Life Remember its price,
If you say reba its principle,
But really its pride,
Raw I preach,
Remember it please,
If you dont just remember this piece,
So next time you hear me say R.I.P.
Know I dont just mean rest in peace,
I mean rewind it please,
So we can remain in peace,