IRC logs for #openttd on OFTC at 2018-06-11
⏴ go to previous day
01:02:22 *** Thedarkb-X40 has joined #openttd
01:11:38 *** supermop has joined #openttd
01:17:02 *** OsteHovel has joined #openttd
01:38:10 *** supermop has joined #openttd
04:46:47 *** planetmaker has joined #openttd
04:47:23 *** planetmaker is now known as Guest5168
04:47:49 *** muffindrake2 has joined #openttd
05:01:54 *** ToffeeYogurtPots has quit IRC
05:02:16 *** ToffeeYogurtPots has joined #openttd
08:02:13 *** pm is now known as Guest5175
08:07:27 *** mijndert has joined #openttd
08:20:25 *** planetmaker_ has joined #openttd
10:05:52 *** ToffeeYogurtPots has quit IRC
10:11:33 *** planetmaker has joined #openttd
10:11:53 *** planetmaker is now known as Guest5183
10:14:12 *** Guest5183 is now known as planetmaker
10:19:54 *** tokai|noir has joined #openttd
10:19:54 *** TheMask96 has joined #openttd
10:19:54 *** luaduck has joined #openttd
10:19:54 *** cute[m] has joined #openttd
10:19:54 *** vlanik2[m] has joined #openttd
10:19:54 *** Terkhen has joined #openttd
10:19:54 *** Antheus has joined #openttd
10:19:54 *** V453000 has joined #openttd
10:19:54 *** Guest4545 has joined #openttd
10:19:54 *** michi_cc has joined #openttd
10:19:54 *** TrueBrain has joined #openttd
10:19:54 *** fonsinchen has joined #openttd
10:19:54 *** argoneus has joined #openttd
10:19:54 *** KenjiE20 has joined #openttd
10:19:54 *** lastmikoi has joined #openttd
10:19:54 *** jonty-comp has joined #openttd
10:19:54 *** m1cr0man has joined #openttd
10:19:54 *** ericnoan has joined #openttd
10:19:54 *** Sheogorath has joined #openttd
10:19:54 *** liquid.oftc.net sets mode: +vooo tokai|noir Terkhen Guest4545 orudge
10:19:54 *** Alkel_U3 has joined #openttd
10:19:54 *** grossing has joined #openttd
10:19:54 *** liquid.oftc.net sets mode: +v orudge
10:20:12 *** ChanServ sets mode: +v Terkhen
10:20:12 *** ChanServ sets mode: +v michi_cc
10:24:15 *** jonty-co1p has joined #openttd
10:25:45 *** TrueBrain has joined #openttd
10:26:23 *** V453000 has joined #openttd
10:26:29 *** tokai|noir has joined #openttd
10:26:29 *** luaduck has joined #openttd
10:26:29 *** cute[m] has joined #openttd
10:26:29 *** vlanik2[m] has joined #openttd
10:26:29 *** Terkhen has joined #openttd
10:26:29 *** Antheus has joined #openttd
10:26:29 *** Guest4545 has joined #openttd
10:26:29 *** michi_cc has joined #openttd
10:26:29 *** fonsinchen has joined #openttd
10:26:29 *** argoneus has joined #openttd
10:26:29 *** KenjiE20 has joined #openttd
10:26:29 *** lastmikoi has joined #openttd
10:26:29 *** m1cr0man has joined #openttd
10:26:29 *** ericnoan has joined #openttd
10:26:29 *** Sheogorath has joined #openttd
10:26:29 *** liquid.oftc.net sets mode: +vooo tokai|noir Terkhen Guest4545 orudge
10:26:29 *** Alkel_U3 has joined #openttd
10:26:29 *** grossing has joined #openttd
10:26:29 *** liquid.oftc.net sets mode: +v orudge
10:26:44 *** ChanServ sets mode: +v Terkhen
10:26:44 *** ChanServ sets mode: +v michi_cc
10:31:35 *** TheMask96 has joined #openttd
10:33:31 *** lastmikoi has joined #openttd
10:33:43 *** ChanServ sets mode: +v tokai
10:33:55 *** TheMask96 has joined #openttd
10:33:55 *** tokai|noir has joined #openttd
10:33:55 *** luaduck has joined #openttd
10:33:55 *** cute[m] has joined #openttd
10:33:55 *** vlanik2[m] has joined #openttd
10:33:55 *** Terkhen has joined #openttd
10:33:55 *** Antheus has joined #openttd
10:33:55 *** Guest4545 has joined #openttd
10:33:55 *** michi_cc has joined #openttd
10:33:55 *** fonsinchen has joined #openttd
10:33:55 *** argoneus has joined #openttd
10:33:55 *** KenjiE20 has joined #openttd
10:33:55 *** m1cr0man has joined #openttd
10:33:55 *** Sheogorath has joined #openttd
10:33:55 *** liquid.oftc.net sets mode: +vooo tokai|noir Terkhen Guest4545 orudge
10:33:55 *** Alkel_U3 has joined #openttd
10:33:55 *** grossing has joined #openttd
10:33:55 *** liquid.oftc.net sets mode: +v orudge
10:34:09 *** ChanServ sets mode: +v Terkhen
10:34:09 *** ChanServ sets mode: +v michi_cc
10:37:13 *** argoneus_ has joined #openttd
10:38:29 *** ericnoan has joined #openttd
10:40:35 *** TheMask96- has joined #openttd
11:12:58 *** chomwitt has joined #openttd
12:02:02 *** Wacko1976 has joined #openttd
12:32:44 *** Thedarkb-X40 has joined #openttd
12:51:38 *** ANIKHTOS has joined #openttd
14:33:50 *** supermop has joined #openttd
14:47:53 *** ToBeFree has joined #openttd
14:50:25 *** snail_UES_ has joined #openttd
15:26:07 *** Thedarkb has joined #openttd
15:26:31 *** mijndert has joined #openttd
15:50:00 *** Lejving has joined #openttd
16:01:13 *** sla_ro|master has joined #openttd
16:17:30 *** Wacko1976 has joined #openttd
16:55:03 *** synchris has joined #openttd
17:02:45 *** muffindrake has joined #openttd
17:03:23 *** Wacko1976 has joined #openttd
17:34:23 *** Thedarkb has joined #openttd
17:35:37 <ANIKHTOS> lets say i have 3 variables a,b c and i make a switch function a+b+c=0; a+b=0 ; a=0l a not 0 how c++ will handle this switch?? when all a=b=c=0 what will happen ? execute 1 part of code or 3 parts??
17:43:39 <FLHerne> ANIKHTOS: Switch cases can only be constant expressions, so you can't do that
17:44:37 <ANIKHTOS> s- a+b=C-o is nto consider a constant??
17:45:52 <Eddi|zuHause> the first thing you should learn is that = is not the operator for comparison. == is
17:46:23 <nielsm> yes, in C and C++, a single = means "assign to the thing on the left" (change the value)
17:46:42 <nielsm> a double == means "compare the two sides for equality"
17:48:59 *** HerzogDeXtEr has joined #openttd
17:49:43 <LordAro> maybe you ahould start with functional programming :p
17:49:58 <ANIKHTOS> can i have a switch with a+b+c==0, a+b==0 a==0 a not 0???
17:50:12 <ANIKHTOS> can i ahve this switch or it is nor possible??
17:50:37 <LordAro> i think we need a bit more information about what you're trying to achieve
17:51:00 <ANIKHTOS> there will be 3 coutners that will reset
17:51:03 <LordAro> what code do you have so far? (put it on pastebin.com or whereever)
17:51:14 <ANIKHTOS> and when the coutner reach 0 i want a code to run
17:51:44 <ANIKHTOS> but dependign if i have 1 at 0 2 at 0 or 3 at zero i want diferent outcome and oen case none is zero
17:53:48 <ANIKHTOS> i can do it with a nested if else function
17:54:55 <nielsm> yes you have to make a series of "if ... else if ... else ..."
17:55:06 <nielsm> I think you said you have worked with visual basic before, right?
17:55:51 <nielsm> I remember that you can do "select case 0 of when a+b+c when a+b ..." or something like that
17:55:58 <nielsm> that's not possible in c++
17:56:18 <nielsm> you can make the same logic but you have to express it with an if/else chain
17:57:27 <ANIKHTOS> well okey i can make the constant a+b+c then cases 0, c a+b other
17:57:52 <ANIKHTOS> it will check the sum of a,b,c to 4 cases
17:58:40 *** TheMask96 has joined #openttd
17:58:49 *** planetmaker_ has joined #openttd
18:00:53 <ANIKHTOS> okey general in c++ in swittch if more than 1 brach is true what c++ do execute all that matches or only the first that is true and then leave the switch ??
18:01:30 <nielsm> C++ switches should be thought of as jump tables
18:02:13 <nielsm> it jumps to the case label that has the value the switch expression is calculated to
18:02:24 <nielsm> (or the default case if none matches)
18:03:24 <ANIKHTOS> i am reading some sites
18:03:39 <ANIKHTOS> and i am tryign to figuere out the diferences between c and visual basic
18:04:58 <LordAro> (switches are under "Control Structures")
18:10:15 <ANIKHTOS> thats what i am reading lord ara
18:10:24 <ANIKHTOS> the secodn link you send is what i read
18:10:53 <Eddi|zuHause> whatever you think a switch does in C++, it does something completely different from what you think
18:11:43 <LANJesus> i imagine a switch in C++ does roughly the same thing as it does in C
18:11:46 <LANJesus> basically a jump table
18:12:28 <Eddi|zuHause> and for what you are trying to do, a switch is (probably) not your solution
18:13:05 <LANJesus> if elseif chains are fun
18:13:26 <ANIKHTOS> they are fun but i always forget co lose 1
18:13:37 <ANIKHTOS> and in the end it take me so many horus to figure out which one is nto closed
18:15:22 <planetmaker_> ANIKHTOS, that might be MUCH easier with the proper editor :)
18:17:15 <ANIKHTOS> well i mange to *#%* even the editor because i copy paste lots of code to spead up the writing and ljust add the difference so some time i delete a brancket and all hell break loose
18:19:28 <ANIKHTOS> is tthere anywhere a reference how heavy is each function to be run?? for optimizign the code and make it lighter to run??
18:20:28 <nielsm> not something general that I know of
18:20:48 <nielsm> division is very slow, multiplication is somewhat slow, addition and subtraction is fast
18:21:02 <nielsm> string operations are somewhat slow
18:21:08 <ANIKHTOS> thanks a lot nielsen that helps alot
18:21:09 <nielsm> but what really matters is your algorithms
18:22:17 <nielsm> allocating memory can be slow but it depends on the specific circumstances, and OTTD has several cases of custom allocators and pools that change this around
18:22:19 <LordAro> rule 0: don't try to optimise until you need to
18:22:34 <nielsm> make it work, then make it fast
18:22:36 <LordAro> (rule -1: plan ahead so you don't need to ;) )
18:22:56 <ANIKHTOS> well once i wrote a code make a test scenario and the computer crahed lol
18:23:09 <ANIKHTOS> the code was workign fine but it took so much powerrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr to execute
18:23:58 <ANIKHTOS> i throw the code out the window re write ti and th enew code was actuall usable
18:23:59 <LordAro> i'd suggest that the code was not working fine :p
18:24:20 <nielsm> if it crashes you're doing something wrong
18:24:25 <ANIKHTOS> it was in a database
18:24:28 <nielsm> possibly trying to allocate more memory than possible
18:24:31 <ANIKHTOS> when datebase was msall all good
18:24:39 <ANIKHTOS> when i make database huge for test it crashed
18:25:03 <ANIKHTOS> okey it was 100% cpu power for ever to finish
18:25:07 <LordAro> ANIKHTOS: do try to watch your spelling, it's getting a bit hard to read
18:25:10 <ANIKHTOS> i close the database manual
18:30:20 *** Wacko1976 has joined #openttd
19:06:31 *** Wormnest has joined #openttd
19:16:00 *** Progman has joined #openttd
19:34:17 *** Thedarkb has joined #openttd
19:47:36 *** supermop_work_ has joined #openttd
19:47:56 *** frosch123 has joined #openttd
19:51:18 *** ToffeeYogurtPots has joined #openttd
20:30:03 <Wolf01> Eddi|zuHause: go and post "state machine" :P
20:37:27 *** Supercheese has joined #openttd
21:03:37 *** gelignite has joined #openttd
21:05:18 *** Wacko1976 has joined #openttd
21:26:58 *** Wacko1976_ has joined #openttd
21:31:06 *** tokai|noir has joined #openttd
21:31:06 *** ChanServ sets mode: +v tokai|noir
23:47:23 <Eddi|zuHause> Wolf01: how did that become my job?
23:54:24 <supermop_work_> hmm shunting now?
continue to next day ⏵