----BEGIN CLASS---- [13:29] #startclass [13:29] Roll Call [13:29] sahil [13:29] Abdul Raheem :) [13:29] Mayank Singhal [13:29] Jason Braganza [13:29] Shruti Dash [13:29] Pawan [13:29] Karan Pratap [13:29] Naman Sharma [13:29] pooja sulakhe [13:29] Sandeep Kumar Choudhary [13:29] Priyanka Saggu [13:29] Bhavin Gandhi [13:29] tabrez khan [13:29] pooja kumari singh [13:29] devesh verma [13:29] Kumar Vipin Yadav [13:29] Soniya Vyas [13:30] Jagannathan Tiruvallur Eachambadi [13:30] Shital Mule [13:30] Prajit Mukherjee [13:30] Deep [13:30] You can very easily notice how the number of participants is dropping week by week :) [13:30] Shubham Sharma [13:31] Ashish Kumar Mishra [13:31] Prashant Sharma [13:31] Vishal Kushwaha [13:32] absolutely kushal [13:33] sehenaz, you added your entry on top of my text in the first row. [13:33] Please add it at the end from next time. [13:33] I am going to clean the pad. [13:34] Who all tried to the "Game of sticks" in the looping chapter? [13:35] * tried to play [13:35] tell yes/no [13:35] no [13:35] Yes [13:35] yes [13:35] no [13:35] no [13:35] no [13:35] me [13:35] kushal, me [13:35] No [13:35] me [13:35] yes [13:35] no [13:35] no [13:35] no [13:36] no [13:36] yes [13:36] no [13:36] no [13:36] no [13:36] kushal, yes [13:37] kushal, yes [13:38] From the reply, we can see that kps_ and inquiridortechie never read the question I asked properly. [13:38] sorry kushal [13:38] yes [13:39] inquiridortechie, you don't have to tell me sorry, but have to learn :) [13:39] sorry kushal i didnt get it :/ [13:39] i was disconnected so plz tell me for what happen in last 5 minutes [13:39] abhishek_, plz no tel [13:40] yes [13:40] On the other hand, who all read https://kushaldas.in/pages/hacker-ethic-and-free-software-movement.html ? answer if yes/no [13:40] yes [13:40] * answer in yes/no [13:40] yes [13:40] yes [13:40] yes [13:40] yes [13:40] no [13:40] no [13:40] yes [13:40] no [13:40] yes [13:40] yes [13:40] yes. [13:41] yes [13:41] kushal, yes. [13:41] kushal, yes [13:41] yes [13:41] yes [13:41] no [13:41] Yes [13:41] yes [13:42] yes [13:42] If you have read that article, you would have seen that the first generation hackers started with tinkering with the tools and also the hardware as required. [13:42] Mostly because the source code was available back then. [13:43] Now, Free Software also allows you to have the similar level of control on the software you run. [13:43] kushal,no [13:43] The hacker mindset is always curious. [13:43] people want to know how is something built. [13:44] You have a small game code in the chapter, you never tried to run it (forget about modifying the code), how do you think you are going to learn? [13:45] I will wait, please try to play around that code, and tell here what ever you learned. [13:45] Speak freely, no need to type ! [13:46] I changed the 5 stick condition to 3 sticks, and since there was no condition to check if the user actually wins, I ended up getting the sticks in -ve :P [13:47] storymode7, hehe [13:47] kushal if the starting sticks are 20 then the user always wins [13:47] kps_, not all users can win [13:48] some people can not do math fast enough (think about young kids) [13:48] kushal, I can never win that game with same code It was an good algorithm. [13:49] A very simple modification will allow the user to get a chance to win? though we have to learn a bit more python for that. [13:49] What if the computer picks first? [13:49] it’s a mod 2 if the user wins [13:50] but kushal when the starting sticks are changed to 20 then the computer always picks up the last stick since the algo always repeats (5-noOfSticksPicked) [13:50] kushal, then i never loose :) [13:50] no matter how many sticks the user provides [13:50] kps_, :) [13:53] kushal: if I change the number of sticks from 21 to 20, there is no end condition. The game goes on and on with the number of sticks becoming negative [13:53] *number of sticks left [13:53] kps_, ^^ [13:54] kps_, do you want to help ash_mishra ? [13:54] kushal, actually he's right [13:54] i missed that [13:54] the code needs a little modification [13:55] Kushal i am getting permission denied whilr executing the file [13:56] there's really no end condition then [13:56] natsuDragneel: is the file's permission correct? Is it executable? [13:56] natsuDragneel: does your file have execute permission? [13:56] natsuDragneel: if not then you can try `chmod +x filename.py` [13:57] natsuDragneel, or do `python3 file.py` [13:57] we can win by incrementing/decrementing the value of sticks by 1 also [13:57] storymode7 i even did the chmod command for making it executable [13:57] or use the mu editor [13:57] or notebook :) [13:58] but as I incremented the no of sticks by 1 then I won but after computer taking sticks it shows Sticks left: -3 [13:58] cypher01: we can, but the game doesn't end there, it goes on in an infinite loop. Technically there's no message saying you won. [13:59] yes, need to work on it [13:59] natsuDragneel: what command are you using? "./filename" to execute it? Is it working fine with "python3 filename.py" like kps_ said? [13:59] we can add a condition if(sticks<1): you win [14:00] i mean elif [14:00] we can change “loose” to “win” :P [14:00] vishalIRC: XD [14:00] vishalIRC, wow [14:00] advantages of open source :p [14:01] it should be lose though [14:01] j605 haha [14:01] storymode7 python3 filename.py is working [14:01] j605: hehe never noticed that :P [14:01] vishalIRC, that is cleaver :) [14:01] Hehe. [14:01] natsuDragneel, can u do a ls -l and check if the x permission is there? [14:02] kps_, can you please learn to type you? [14:02] oh sorry kushal [14:02] natsuDragneel: yup. Verify if the executable permission is there. [14:02] kps_, it is already more than a month, and you still can not type properly. [14:03] i try my best to do that [14:03] ash_mishra: we can resolve it via while (sticks>0): 😇, but there won't be any message printed if we won either. That would be between us and computer only. [14:03] will not repeat it again [14:03] kushal is the computer taking 5 sticks? [14:04] natsuDragneel did you add this line at top #! /usr/bin/env python3 [14:04] no it takes 5-theNumberOfSticksYouTook [14:04] VirtualRcoder, you have a space in that line [14:04] prabhuss, ^^ see what kps_ replied. [14:05] okay kushal [14:05] Oh! that by mistake kushal [14:06] natsuDragneel, that should be #!/usr/bin/env python3 [14:06] is session started? [14:07] I think there should be an option whether the user will start first or the computer. [14:07] ok really dumb question [14:07] i kind of understand while x = something, do [14:07] but what does while True mean? [14:07] while what is true? [14:07] always true [14:07] jasonbraganza, while True means never stop [14:08] infinity loop. [14:08] the loop keeps on running infinitely [14:08] unless there is a break inside. [14:08] jasonbraganza, the condition is true, therefore keep running. [14:08] until break [14:08] oh, ok that clears up a lot :) thank you kushal kps_ :) [14:08] use while (sticks>0): [14:08] jasonbraganza: Unconditional loop , it never break unless explicitly given [14:08] vishalIRC, yea, but i wan’t getting the hang of “WHICH” conition :) [14:09] cypher01, here are a few issues in that line. [14:09] We are writing Python, means no need of those extra () [14:09] vshuklajr thank you :) [14:09] also there should a space before and one space after > [14:10] use while > 0: ** :) [14:10] jasonbraganza, i didn’t get that? [14:10] I tried to change that condition also, the computer take the last in that case, but still no message printed. Because in that case, while loop stops :( [14:11] vishalIRC, never mind. i understood :) [14:11] jasonbraganza, ok cool. [14:11] priyankasaggu119: agreed with you :) [14:11] i meant use while sticks > 0: 😅 [14:12] i am unable to understand where is computer taking "1" stick? [14:13] prabhuss, i think it's in the last line [14:13] prabhuss: the computer takes (5 - sticks_taken), so if you take 4 sticks, the computer takes (5-4)=1 stick, line 16 I guess. [14:13] when we take 4 sticks it takes 1 stick i guess [14:13] prabhuss: no where. *currently* computer takes 5 - No of sticks you took. So in every run total of 5 sticks are reduced. And since total sticks are 21 therefore 1 is left for user always never computer. [14:13] prabhuss, Computer will take one stick if you type 4. Did i understand your question correctly [14:14] I got it. Can anyone confirm that the total number of sticks taken by me and computer are always 5? [14:14] Yes [14:14] prabhuss [14:14] prabhuss: yes [14:14] x + (5 - x ) = 5 [14:14] Yes [14:14] prabhuss Yes that is the trick. The user is always left with 1 at the end if the user starts first. [14:14] I feel like it would only when the computer picks up the first stick:) [14:15] thanks ABD ash_mishra storymode7 VirtualRcoder ann :) [14:15] :) [14:15] Happy to do so :) [14:15] so if the number of sticks in (5*n + 1) you can never win [14:16] exactly ash_mishra [14:16] ash_mishra, got it...that's a sick game :) Awesome [14:16] So if you can't win the game, better change the game. [14:16] prabhuss: you helped me understand the logic of why 21. Thank you :) [14:17] This is what we know as learning together. [14:17] :) happy to do so unintentionally. That's what happens when we learn together :D [14:19] How many of you follow/know/admire Sachin Tendulkar ? [14:20] me [14:20] me [14:20] me :) [14:20] me [14:20] me [14:20] me [14:20] me [14:20] me [14:20] me [14:20] me [14:20] me [14:20] me [14:20] me [14:20] me [14:20] me [14:20] We know him as the God of cricket. But, even he had to wait 22 years to win the world cup. [14:20] me [14:21] yes [14:21] This is where https://www.norvig.com/21-days.html is so important. [14:21] To learn syntax of any language, you will just have to look at a book or documentation. [14:22] me [14:22] But, to learn programming you will have to read and write code [14:22] For many hours. [14:22] This is an habit. [14:22] You will have to build it. [14:23] +1 [14:23] Next, spend your time with the https://pymbook.readthedocs.io/en/latest/datastructure.html chapter. [14:23] Take the whole weekend for this if required. [14:24] try out those different things. [14:24] If you have queries, ask here. [14:24] Hopefully someone will reply. [14:24] ok kushal [14:24] ok [14:24] Any more questions? Or else we can end the session now. [14:24] ! [14:24] next [14:25] while typing the command for mu editor ,what is on the command line Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway ? [14:27] you can try to export that variable and see what happens :) ----END CLASS----