d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Make Me A Better Programmer - From Step 1
Prev1383940414256Next
Add Reply New Topic New Poll
Member
Posts: 13,425
Joined: Sep 29 2007
Gold: 0.00
Warn: 20%
Sep 28 2014 02:05am
Quote (carteblanche @ Sep 28 2014 01:16am)
it takes an iron will to last a few hours. most people give up before hello world.


How do I turn this hello world program into vidya game hacks???!!!!111one
Member
Posts: 39,849
Joined: Apr 9 2009
Gold: 3,656.09
Sep 28 2014 07:31pm
Quote (Eep @ Sep 27 2014 08:41pm)
it is a lot of stuff to take in...not something you learn easily/quickly

What specifically is confusing you? You in college? Maybe ask professors.


I literally got spoonfed by my classmates



We were to make a program where it says a letter* one at time.
The codes used has to be in Chapter 2.

This post was edited by MelsonX on Sep 28 2014 07:38pm
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Sep 28 2014 07:33pm
Quote (MelsonX @ Sep 28 2014 09:31pm)
I literally got spoonfed by my classmates

http://i.imgur.com/maOXCjo.png

We were to make a program where it says a word one at time.


you misspelled phrase
Member
Posts: 39,849
Joined: Apr 9 2009
Gold: 3,656.09
Sep 28 2014 07:37pm
Quote (carteblanche @ Sep 28 2014 06:33pm)
you misspelled phrase


Yeah i'm sorry -_-
I got 6/8 because i didn't really explain what the commands does.
spoonfed =(((

This post was edited by MelsonX on Sep 28 2014 07:39pm
Member
Posts: 23,862
Joined: Aug 16 2006
Gold: 20.00
Sep 28 2014 07:41pm
gah, no semicolons. Python is weird :ph34r:
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Sep 28 2014 07:47pm
Quote (MelsonX @ Sep 28 2014 09:37pm)
Yeah i'm sorry -_-
I got 6/8 because i didn't really explain what the commands does.
spoonfed =(((


75% for not knowing anything sounds pretty good to me. more than you deserve for sure.

Quote (Eep @ Sep 28 2014 09:41pm)
gah, no semicolons. Python is weird  :ph34r:


python is tab delimited which i dislike. i like how groovy did it better. you can skip the semicolons if you only use 1 command per line, but you can still put them there if you want to.

This post was edited by carteblanche on Sep 28 2014 07:47pm
Member
Posts: 23,862
Joined: Aug 16 2006
Gold: 20.00
Sep 28 2014 07:49pm
Quote (carteblanche @ Sep 28 2014 08:47pm)
75% for not knowing anything sounds pretty good to me. more than you deserve for sure.



python is tab delimited which i dislike. i like how groovy did it better. you can skip the semicolons if you only use 1 command per line, but you can still put them there if you want to.


groovy sounds pretty cool then
Member
Posts: 39,849
Joined: Apr 9 2009
Gold: 3,656.09
Sep 28 2014 08:00pm
Quote (carteblanche @ Sep 28 2014 06:47pm)
75% for not knowing anything sounds pretty good to me. more than you deserve for sure.



python is tab delimited which i dislike. i like how groovy did it better. you can skip the semicolons if you only use 1 command per line, but you can still put them there if you want to.


I want to practice really but holy sht we have 5 Chapter tests coming on the way this week.
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Sep 28 2014 08:03pm
Quote (Eep @ Sep 28 2014 09:49pm)
groovy sounds pretty cool then


coworker first showed me groovy in the context of json. in java, you need a back-end class for libraries like Gson to convert json to something usable. in groovy you don't.

Code
def slurper = new JsonSlurper()
def result = slurper.parseText('{"person":{"name":"Guillaume","age":33,"pets":["dog","cat"]}}')

assert result.person.name == "Guillaume"
assert result.person.age == 33
assert result.person.pets.size() == 2
assert result.person.pets[0] == "dog"
assert result.person.pets[1] == "cat"


a feature i actually like from php is using $variable-name inside strings, which most languages don't have, so you rely on something like String.format or printf or string concatenation. groovy has something similar:

Code
BigDecimal account = 10.0
BigDecimal minus = 4.0
text = "Your account shows currently a balance of ${account - minus}"
assert text == "Your account shows currently a balance of 6.0"


and you get closures, traits (interfaces with default implementation), duck typing, and other goodies
Member
Posts: 13,425
Joined: Sep 29 2007
Gold: 0.00
Warn: 20%
Sep 28 2014 10:37pm
Quote (MelsonX @ Sep 28 2014 09:31pm)
http://i.imgur.com/maOXCjo.png


Code
gets.each_char {|char| puts char}


Mmm doing someones entire assignment in one logical line.

This post was edited by AbDuCt on Sep 28 2014 10:37pm
Go Back To Programming & Development Topic List
Prev1383940414256Next
Add Reply New Topic New Poll