Pokémon X and Y Fan Community
March 29, 2024, 04:35:40 am
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
  Home Help Search Arcade Gallery SHOUTBOX Staff List Calendar Members Login Register  

Programming Thread

Pages: 1 ... 8 9 [10] 11 12
  Send this topic  |  Print  
Author Topic: Programming Thread  (Read 3309 times)
0 Members and 13 Guests are viewing this topic.
Coyote Starrk
The Ultimate in Prescribed Drugs
Wrathful Whirlipede
*******************

Level: 8
Offline Offline

Gender: Male
Posts: 8653


Primera Espada


View Profile
Badges: (View All)
« Reply #135 on: April 30, 2013, 12:19:16 am »

Because there's going to be a separate award ceremony by the sponsor. Should know soon! (I hope~)
Sponsor? Explain!
Report Spam   Logged

klondikebar
Global Moderator
Malevolent Murkrow
*****

Level: 44
Offline Offline

Posts: 2977


View Profile
Badges: (View All)
« Reply #136 on: April 30, 2013, 01:31:50 am »

You're doing good, keep going Smiley

I won a game development contest today for my university Cheesy Apparently I get a prize but I don't know what it is yet Sad I want to knooooow!

Thank you Tongue

And congrats Cheesy
Report Spam   Logged
klondikebar
Global Moderator
Malevolent Murkrow
*****

Level: 44
Offline Offline

Posts: 2977


View Profile
Badges: (View All)
« Reply #137 on: May 01, 2013, 12:15:55 pm »

So, I'm looking at Lua and Love2D, and I'm thinking it looks insanely powerful for a scripting language. This guy made some awesomeness in only 8 hours: http://iwasdeportedandalligotwasthislousydomain.co.uk/index.php?entry=entry130501-122423
Report Spam   Logged
Shihen
Magical Misdreavus
****

Level: 5
Offline Offline

Posts: 126


View Profile WWW
Badges: (View All)
« Reply #138 on: May 02, 2013, 02:41:25 am »

So, I'm looking at Lua and Love2D, and I'm thinking it looks insanely powerful for a scripting language. This guy made some awesomeness in only 8 hours: http://iwasdeportedandalligotwasthislousydomain.co.uk/index.php?entry=entry130501-122423
Aaah I've seen quite a few people using Love2D in Ludum Dare. Personally haven't tried it and I don't think it's for me xD (Quite happy with what I already know) but let us know how it goes if you choose to expand on it.

Thank you Tongue

And congrats Cheesy

Thank you Smiley

Sponsor? Explain!

I'll explain once I get my prize D: (It's not like I don't even know who is sponsoring us)
Report Spam   Logged

klondikebar
Global Moderator
Malevolent Murkrow
*****

Level: 44
Offline Offline

Posts: 2977


View Profile
Badges: (View All)
« Reply #139 on: May 02, 2013, 03:30:18 pm »

I'm at the point in Learn Python the Hard Way where I previously gave up last time. Wish me luck...
Report Spam   Logged
Coyote Starrk
The Ultimate in Prescribed Drugs
Wrathful Whirlipede
*******************

Level: 8
Offline Offline

Gender: Male
Posts: 8653


Primera Espada


View Profile
Badges: (View All)
« Reply #140 on: May 02, 2013, 03:40:05 pm »

I'm at the point in Learn Python the Hard Way where I previously gave up last time. Wish me luck...
May the old gods and the new protect you on your journey!
Report Spam   Logged

Magoo
Princess
Gargantuan Gabite
******************

Level: 34
Offline Offline

Gender: Male
Posts: 6724


Wayward Son


View Profile WWW
Badges: (View All)
« Reply #141 on: May 02, 2013, 09:10:11 pm »

May the old gods and the new protect you on your journey!

And the forbidden ones too.
Report Spam   Logged


In the distance, that day, when the star became music.
Coyote Starrk
The Ultimate in Prescribed Drugs
Wrathful Whirlipede
*******************

Level: 8
Offline Offline

Gender: Male
Posts: 8653


Primera Espada


View Profile
Badges: (View All)
« Reply #142 on: May 02, 2013, 09:19:40 pm »

And the forbidden ones too.
Bro, do you even Westeros?
Report Spam   Logged

Shihen
Magical Misdreavus
****

Level: 5
Offline Offline

Posts: 126


View Profile WWW
Badges: (View All)
« Reply #143 on: May 15, 2013, 02:23:10 pm »

I got my prize for winning that game development contest finally! Cheesy (Prepare to spot the irony) I got an Android tablet running ICS (4.04) and a Ł15 iTunes coupon. Followed by a free lunch and getting to talk to the sponsor directly. Learned lots of information about himself, his company, and the industry. Wouldn't mind winning things more often Smiley
Report Spam   Logged

klondikebar
Global Moderator
Malevolent Murkrow
*****

Level: 44
Offline Offline

Posts: 2977


View Profile
Badges: (View All)
« Reply #144 on: May 15, 2013, 03:47:30 pm »

I got my prize for winning that game development contest finally! Cheesy (Prepare to spot the irony) I got an Android tablet running ICS (4.04) and a £15 iTunes coupon. Followed by a free lunch and getting to talk to the sponsor directly. Learned lots of information about himself, his company, and the industry. Wouldn't mind winning things more often Smiley

Congrats!

In my programming news, I caught up to where I was last time I tried to learn Python, but am now stuck because, once again...
I can't understand freaking classes... every damn time, I just fail at understanding them...
Report Spam   Logged
Coyote Starrk
The Ultimate in Prescribed Drugs
Wrathful Whirlipede
*******************

Level: 8
Offline Offline

Gender: Male
Posts: 8653


Primera Espada


View Profile
Badges: (View All)
« Reply #145 on: May 15, 2013, 04:28:31 pm »

I got my prize for winning that game development contest finally! Cheesy (Prepare to spot the irony) I got an Android tablet running ICS (4.04) and a Ł15 iTunes coupon. Followed by a free lunch and getting to talk to the sponsor directly. Learned lots of information about himself, his company, and the industry. Wouldn't mind winning things more often Smiley
It's ironic cuz youre country doesnt use pounds? :O


Congrats!

In my programming news, I caught up to where I was last time I tried to learn Python, but am now stuck because, once again...
I can't understand freaking classes... every damn time, I just fail at understanding them...
Hit up the programming thread on /g/ perhaps?
Report Spam   Logged

Shihen
Magical Misdreavus
****

Level: 5
Offline Offline

Posts: 126


View Profile WWW
Badges: (View All)
« Reply #146 on: May 15, 2013, 07:31:13 pm »

Congrats!

In my programming news, I caught up to where I was last time I tried to learn Python, but am now stuck because, once again...
I can't understand freaking classes... every damn time, I just fail at understanding them...
Thanks!

I remember the time that I had no idea how classes worked. Always tried to grasp them in PHP but because they weren't forced I never used them.
I recommend learning Java for a while. It's where I really learned how to use classes and understand them the best. Or just ask away, we can answer your questions Cheesy

It's ironic cuz youre country doesnt use pounds? :O

Hit up the programming thread on /g/ perhaps?
I do in fact live in England so pounds are indeed my currency. Just an iTunes coupon with an Android tablet? I don't even have a single product/service that would make use of that Tongue I just gave it away to my friend to use.
Report Spam   Logged

Coyote Starrk
The Ultimate in Prescribed Drugs
Wrathful Whirlipede
*******************

Level: 8
Offline Offline

Gender: Male
Posts: 8653


Primera Espada


View Profile
Badges: (View All)
« Reply #147 on: May 15, 2013, 09:21:51 pm »

Thanks!

I remember the time that I had no idea how classes worked. Always tried to grasp them in PHP but because they weren't forced I never used them.
I recommend learning Java for a while. It's where I really learned how to use classes and understand them the best. Or just ask away, we can answer your questions Cheesy
I do in fact live in England so pounds are indeed my currency. Just an iTunes coupon with an Android tablet? I don't even have a single product/service that would make use of that Tongue I just gave it away to my friend to use.
Doesnt android support AAC format by default cuz fuck the poleese?
Report Spam   Logged

klondikebar
Global Moderator
Malevolent Murkrow
*****

Level: 44
Offline Offline

Posts: 2977


View Profile
Badges: (View All)
« Reply #148 on: May 16, 2013, 01:46:35 am »

Thanks!

I remember the time that I had no idea how classes worked. Always tried to grasp them in PHP but because they weren't forced I never used them.
I recommend learning Java for a while. It's where I really learned how to use classes and understand them the best. Or just ask away, we can answer your questions Cheesy

Alright Cheesy

Well, this example from learn python the hard way:

Code:
class Song(object):

    def __init__(self, lyrics):
        self.lyrics = lyrics

    def sing_me_a_song(self):
        for line in self.lyrics:
            print line

happy_bday = Song(["Happy birthday to you",
                   "I don't want to get sued",
                   "So I'll stop right there"])

bulls_on_parade = Song(["They rally around the family",
                        "With pockets full of shells"])

happy_bday.sing_me_a_song()

bulls_on_parade.sing_me_a_song()

I understand that the last two lines will call each song as a parameter in the sing_me_a_song function, but I don't get the whole 'self' thing. In song me a song you use 'self' as a parameter... which for some reason doesn't make sense to me...

And this:
Code:
def __init__(self, lyrics):
        self.lyrics = lyrics

I don't even know how to comprehend it, I know it's meant to basically start the class, but I can't see what it does...

Another thing I'm having, is that looking at when I use Song("[Song lyrics]"), I'd assume there'd have to be another parameter because the class has self and lyrics in __init__... why only the lyrics?

Sorry if this was weird to understand, I don't know what I'm talking about and it makes it harder to ask for advice...

Hit up the programming thread on /g/ perhaps?

HAHAHAHAHAHAAHHAHAHAHAHAHAHAHAHA.
No.
Report Spam   Logged
Shihen
Magical Misdreavus
****

Level: 5
Offline Offline

Posts: 126


View Profile WWW
Badges: (View All)
« Reply #149 on: May 16, 2013, 02:15:42 am »

Code:
def __init__(self, lyrics):
        self.lyrics = lyrics

This is the constructor for the class, consider it a special function (method) if you will. Everytime an object is created from that class then the constructor will be called. You'll notice the arguments 'self' and 'lyrics'. The self argument is a little complicated because it works in a different way than all the other arguments. (I'll come back to it later)
For 'lyrics', that's basically the variable that will hold any value you pass into your class when you create it. All arguments after 'self' are entirely optional and up to the programmer.

Code:
class Car():
    colour = "Unknown"
   
    def __init__(self, col):
        print(col)

car = Car("Red")
Will output "Red". If you were to change the print(col) to print(colour), then we'd get an error because the variable 'colour' is not in the function (__init__). To access it you'd have to use self.colour so, print(self.colour) would print out "unknown".
Setting the variable works in the same way:

Code:
class Car():
    colour = "Unknown"
   
    def __init__(self, col):
        self.colour = col

    def get_color(self):
        print(self.colour)

car = Car("Red")
car.get_color()

Each function in a class MUST have 'self' as a parameter. This is because Python passes an extra value behind the scenes, which goes into the self variable. It doesn't have to be called 'self' either, you can rename it to what you like. It'll still work in the same way.

As for this line:
Code:
class Song(object):
(object) is forcing whatever you pass into __init__ as an argument (lyrics) to be an object data type. That's all really. Try setting (object) to (int) and you'll see that you'll only be able to pass ints into lyrics.
Report Spam   Logged

Pages: 1 ... 8 9 [10] 11 12
  Send this topic  |  Print  
 
Jump to:  

Powered by EzPortal
Bookmark this site! | Upgrade This Forum
Free SMF Hosting - Create your own Forum

Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy
Page created in 0.076 seconds with 28 queries.