syntaxwise, what is the best programming language?

Poll: syntaxwise, what is the best programming language?
You do not have permission to vote in this poll.
python
28.57%
6 28.57%
i don't know any languages
23.81%
5 23.81%
{i; {have; {a; {blatantly; {wrong; {opinion;}}}}}}
47.62%
10 47.62%
Total 21 vote(s) 100%
* You voted for this item. [Show Results]

Thread Rating:
  • 3 Vote(s) - 3.67 Average
  • 1
  • 2
  • 3
  • 4
  • 5
syntaxwise, what is the best programming language?
#25
RE: syntaxwise, what is the best programming language?
heres a map generator i made in python, please judge softly

Code:
from Tkinter import *
from random import randint

def buildIsland(xStart, yStart, landCounter, blobbiness):
    global mapArray
    
    mapArray[xStart][yStart] = "green"
    while landCounter >= 0:
        xCoord = xStart
        yCoord = yStart
        
        while(mapArray[xCoord][yCoord] == "green"):
            if xCoord >= 1 and xCoord <= 299:
                xCoord += randint(0,2) - 1
            elif xCoord >= 1:
                xCoord -= 1
            elif xCoord <= 299:
                xCoord += 1
            if yCoord >= 1 and yCoord <= 299:
                yCoord += randint(0,2) - 1
            elif yCoord >= 1:
                yCoord -= 1
            elif yCoord <= 299:
                yCoord += 1
            
        mapArray[xCoord][yCoord] = "green"    
        landCounter -= 1

        if randint(0,blobbiness) == 1:
            xStart = xCoord
            yStart = yCoord

master = Tk()

xCoord = 150
yCoord = 150

canvasWidth = 300
canvasHeight = 300

xCounter = 0
yCounter = 0

zoomLevel = 1

mapArray = [["blue" for x in range(canvasWidth + 1)] for y in range(canvasHeight + 1)]

#Build islands
for x in range(0,50):
    buildIsland(randint(0,300),randint(0,300),randint(150,2000),1)

#Set up canvas
drawMap = Canvas(master, width = canvasWidth * zoomLevel, height = canvasHeight * zoomLevel)
drawMap.pack()

#Draw map
while(yCounter <= canvasHeight):
    while(xCounter <= canvasWidth):
        drawMap.create_rectangle(xCounter * zoomLevel, yCounter * zoomLevel, (xCounter * zoomLevel)+ zoomLevel,
                                (yCounter * zoomLevel) + zoomLevel, fill=mapArray[xCounter][yCounter],
                                 outline=mapArray[xCounter][yCounter])
        xCounter += 1
        
    xCounter = 0
    yCounter += 1

mainloop()
Quote


Messages In This Thread
RE: syntaxwise, what is the best programming language? - by Loather - 08-17-2016, 01:23 PM
Bingogogo - by Reyweld - 05-04-2018, 01:12 PM