Guest User

Untitled

a guest
Jan 20th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.11 KB | None | 0 0
  1. DAY1.
  2. 1.i couldnt install xcode, appstore says i need osx 10.12.6 or later version.
  3. 2.we can open atom from terminal entering atom .
  4. 3..rb
  5. 4.CMD+/ or tree-view:toggle
  6.  
  7. 6.pwd stands for present working directory .
  8. 7.ls lists the files in current folder. cd is to move to other directory.mkdir is to make a new directory.
  9. 8.local
  10. 9.see comments
  11.  
  12. DAY2
  13. 1.we can simply enter irb into command line to enter irb session
  14. 2.**2
  15. Part II
  16. 1.puts
  17. 2.by typing commands.
  18. 3.#indicates a comment.
  19. 4."turing".length returns 6
  20. DAY3
  21. *variables
  22. 1. examample:my_variables=10
  23. 2.when naming variables we can not use all numbers ,an underscore , a dash, a number at the start.
  24. 3.we can change the value of variables by typing the name again with a different value on the command line.
  25. *datatypes
  26. 1.we can find class of a variable by doing .class at the end.
  27. 2.:chop, :chomp,
  28. 3.5.to_s converts 5 to string.
  29. *strings
  30. 1.beacuse we can not perform string interpolation
  31. 2.#{} is used for string interpolation.
  32. 3..delete('aeiou')
  33. *input and output
  34. 1.puts is like print used to print out the informetion to the user of a program but print doest make a new line
  35. 2.gets pauses program.
  36. DAY4
  37. 1.intergers are whole numbers where floats are decimal.
  38. 2.2**2
  39. Booleans
  40. 1.
  41. * == equal.
  42. ** greater or equal.
  43. *** smaller or equal.
  44. **** not equal
  45. ***** && means everything must be true.
  46. ****** || means at least one must be true.
  47. 2..end_with? , .include?
  48. Conditionals
  49. 1.if our program makes decision for us then thats called flow control.
  50. 2.not many apples
  51. 3.if loop body doesn't do anything to make the while condition false, loop will run forever and called infinite loop. we can type ctrl +c to get out of it.
  52. NIL
  53. 1.nil is a special Ruby data type that means "nothing".
  54. SYMBOLS
  55. 1.Symbols help Ruby use memory more efficiently
  56. 2.no.
  57. ARRAYS
  58. 1..length can be used to find out number of elemnets in array.
  59. 2. the index of pizza is 0.(probably).
  60. 3. push adds a new element to the end of the array and pop removes (and return) the element at the end of the array
  61. Hashes.
  62. 1.hashes have keys and values where arrays have elements separated by commas. arrays use square brackets while hashes use curly braces.
  63. 2.Arrays are used whenever you need to work with a large group of similar items.but if we want to find an element by using their name than index then we prefer hashes.
  64. DAY5
  65. excercise 1.
  66. 1."Turing"[0]
  67. 2. .length
  68. 3. .upcase
  69. 4. .delete("n")
  70. 5. a4 = "turing"
  71. excercise 2.
  72. 1.
  73. 2.
  74. 3.changes to integer.
  75.  
  76. Excercise 3.
  77. 1. returns 4
  78. 2.dog
  79. 3.false
  80. 4. .push("name_of_the_animal")
  81. 5.animals.pop
  82.  
  83. day7
  84. i learned a basic idea of ruby language but im always confused between irb and the normal command line like typing cd ~ on irb.i could not create a game today unfortunately. i spent seven days to finish the work but i feel like i have skipped some parts of prework. i couldnt find the way to start a game. i still have some time until we start day 1 . i will dive into that furthermore for next 7 days. one of the challanging part was typing without looking hopefully that gets better over time.
Add Comment
Please, Sign In to add comment