Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by M_D. 04/26/24 20:22
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (M_D, AndrewAMD, Quad, Ayumi), 810 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 5
Page 9 of 22 1 2 7 8 9 10 11 21 22
Re: 100 lines contest [Re: Joozey] #206148
05/11/08 15:02
05/11/08 15:02
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Online
Senior Expert
Quad  Online
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
how can we know it is the real working code ? maybe your one has some extra functions : P


3333333333
Re: 100 lines contest [Re: Quad] #206156
05/11/08 16:45
05/11/08 16:45
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline
Expert
Joozey  Offline
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands
then grab the sourcecode and host it yourself \:D


Click and join the 3dgs irc community!
Room: #3dgs
Re: 100 lines contest [Re: Joozey] #206451
05/13/08 16:37
05/13/08 16:37
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline
Expert
Joozey  Offline
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands


Click and join the 3dgs irc community!
Room: #3dgs
Re: 100 lines contest [Re: Joozey] #206457
05/13/08 16:51
05/13/08 16:51
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
Code:
print open("main.c", "r").read().count(";")

a one line ; counter written in python. smile



btw. i posted a beta of my entry: http://www.coniserver.net/ubb7/ubbthreads.php?ubb=showflat&Number=206455#Post206455

Re: 100 lines contest [Re: ventilator] #206462
05/13/08 17:37
05/13/08 17:37
Joined: Nov 2007
Posts: 1,032
Croatia
croman Offline
Serious User
croman  Offline
Serious User

Joined: Nov 2007
Posts: 1,032
Croatia
it works completely correct. nice job



Ubi bene, ibi Patria.
Re: 100 lines contest [Re: ventilator] #206465
05/13/08 17:44
05/13/08 17:44
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline
Expert
Joozey  Offline
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands
Originally Posted By: ventilator
Code:
print open("main.c", "r").read().count(";")

a one line ; counter written in python. smile


But that also counts the ';' in comments laugh


Click and join the 3dgs irc community!
Room: #3dgs
Re: 100 lines contest [Re: Joozey] #206471
05/13/08 18:10
05/13/08 18:10
Joined: Nov 2007
Posts: 1,032
Croatia
croman Offline
Serious User
croman  Offline
Serious User

Joined: Nov 2007
Posts: 1,032
Croatia
yeah but it tells you how much there is semicolons that are not in comments

first number is all semicolons in code and second number is the number of semicolons that are not inside of comment.



Ubi bene, ibi Patria.
Re: 100 lines contest [Re: Joozey] #206476
05/13/08 18:41
05/13/08 18:41
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
Quote:
But that also counts the ';' in comments laugh

Code:
import re
print re.sub("//.*", "", re.sub(re.compile("/\*.*\*/", re.DOTALL), "", open("main.c", "r").read())).count(";")

still one line (without the import) but a bit nasty to read. :p

Re: 100 lines contest [Re: ventilator] #206495
05/13/08 21:16
05/13/08 21:16
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline
Expert
Joozey  Offline
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands
Ait... I declare you winner. frown


Click and join the 3dgs irc community!
Room: #3dgs
Re: 100 lines contest [Re: Joozey] #206506
05/13/08 21:57
05/13/08 21:57
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
i just did this for fun and out of curiousness and not because i found your counter bad or something. smile

you could use regular expressions like that in php too (ereg_replace() i think). they are great for such things.

Page 9 of 22 1 2 7 8 9 10 11 21 22

Moderated by  George 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1