วันเสาร์ที่ 21 พฤศจิกายน พ.ศ. 2558

Slide AS2 100%

https://docs.google.com/presentation/d/1m_o5MJzvl77ZKWztwsu6jjmbA45Id7jZkJr-DLfNnfU/edit?usp=sharing

GAME : Ruby Aventure ver.Demo

ขนาด 190 MB
ผล งานของ นักศึกษา CprE ของมหาลัย KMUTNB โดยใช้ RPG MAKERช่วย
เนื้อหา : เป็นเกมที่ สอน การเขียนโปรแกรม ภาษา Ruby ขั้น พื้นฐาน และมีเนื้อหาที่ สนุก มีความตลกของเนื้อเรื่อง และ สร้างความเพลิดเพลิน ให้ผู้เล่นได้ และยัง สามารถ นำไปพัฒนาต่อได้อีกด้วย
โหลด : https://drive.google.com/…/0B5rVNPfEzZtaZUpWS0s0VU1IWHM/view


วันพุธที่ 18 พฤศจิกายน พ.ศ. 2558

AS 2 : RUBY TEST คลาสแม่คลาสลูก

class Person
def initialize(name,weight,height)
@name = name
@weight = weight
@height = height
end

def get_name
return @name
end

def get_weight
return @weight
end

def get_height
return @height
end
end

class Student < Person
def initialize(name ,weight ,height ,id_student)
super(name,weight,height)
@id_stu = id_student
end

def get_id_stu
return @id_stu
end
end


def setup
data_student = [Student.new("one",40,160,1),Student.new("two",45,172,2)]
count = 0
while count<data_student.length
puts "number data count is #{count}"
puts "That student name is #{data_student[count].get_name}"
puts "That student weight is #{data_student[count].get_weight}"
puts "That student height is #{data_student[count].get_height}"
puts "That student id_stu is #{data_student[count].get_id_stu}"
count = count +1
end

end

setup


ลอง RUBY WHILE + Function + class + array (find_age & average_age)

class Student
  def initialize(name,id,age)
    @name, @id, @age = name, id, age
  end

  def get_name
    return @name
  end

  def get_age
    return @age
  end
 
end

def average_age(std)
i=0
sum = 0
avg = 0
while i<3
sum = sum+std[i].get_age
i = i+1
end
avg = sum/3
puts "The average age in this classroom = #{avg}"
end

def find_age(std, age)
  i=0
  count=0
  while i<3
    if std[i].get_age<=age
      count=count+1
      puts "#{std[i].get_name} is #{std[i].get_age} years old"
    end
i = i+1
  end
  puts "This classroom have #{count} students with age < 30"
end
 

def setup
  data_student = [Student.new("A",1,25),
          Student.new("B",2,34),
          Student.new("C",3,27)]

  find_age(data_student, 30)
  average_age(data_student)

end

setup

วันอังคารที่ 17 พฤศจิกายน พ.ศ. 2558

ลอง RUBY WHILE + Function + class + array [ 2 ]

class Student
  def initialize(name,w,h)
    @name, @w, @h = name, w, h
  end

  def get_bmi
    bmi=@w/(@h*@h/10000)
    return bmi
  end

  def get_name
    return @name
  end

  def get_w
    return @w
  end

  def get_h
    return @h
  end

end

def find_bmi_more(std, bmi)
  count=0
  for i in (0..2)
    if std[i].get_bmi>=bmi
      count=count+1
      puts "#{std[i].get_name}  BMI more #{bmi}"
    end
  end
  puts "Have BMI more #{bmi} = #{count} P."
end
 

def setup
  data_student = [Student.new("A",59,154),
          Student.new("B",75,179),
          Student.new("C",71,182)]

  for i in (0..2)
    print " BMI of #{data_student[i].get_name} = #{data_student[i].get_bmi}" 
    print " by Weight = #{data_student[i].get_w}"
    print " and Height = #{data_student[i].get_h}"
    puts
  end

  find_bmi_more(data_student, 25)

end

setup

วันอาทิตย์ที่ 15 พฤศจิกายน พ.ศ. 2558

ลอง RUBY WHILE + Function + class + array

class Data_a
  def initialize(name,id,score)
    @name, @id, @score = name, id, score
  end

  def get_name
    "data name #@name"
  end
end

def set_a
   data_student =[Data_a.new("A","01","80"),Data_a.new("B","02","85"),Data_a.new("C","03","87")]
   i = 0
   while i < 3
      puts data_student[i].get_name
      i = i +1
   end
end

set_a




วันเสาร์ที่ 14 พฤศจิกายน พ.ศ. 2558

AS 2 : เป้าหมายในอาทิตย์หน้า และการมอบหมายหน้าที่

  • หาข้อมูลเพิ่มเติม
  • ทำเกม ver.demo ให้เสร็จและเผยแพร่
  • เริ่มทำ สไลด์ พรีเซ็นท์

เนื่องจากเหลือเวลาอีกไม่มากแล้ว จึงจะแบ่งคนในกลุ่มออกเป็น 2 กลุ่ม คือกลุ่ม ที่ศึกษาวิธีการเขียนภาษา Ruby และอีกกลุ่ม ศึกษา วิธีการใช้โปรแกรม RPG maker แล้วจึง มาช่วยกันสร้างเกมขึ้น มา รวมถึง ช่วยสอน ในเรื่องที ตนเองศึกษามาด้วย

กลุ่ม 1 : ศึกษา วิธีการใช้งาน RPG MAKER VX ACE LITE
คือ Earth

RPG MAKER VX ACE LITE


เป็นรุ่น ฟรี และ 
(อ้างบทความจากในเว็ป)
So you've finished your project and you are ready for others to experience your unique RPG. Export your game to a portable EXE file that can be played on ANY Windows system. Share it with your friends, your family, or even the internet!
เขาได้กล่าว ว่า สามารถ ปล่อยเกมที ทำไห้ ผู้อื่นได้ 
ดังนั้นจึงไม่ผิดกฏหมาย

กลุ่ม 2 : ศึกษาวิธีการใช้งาน Ruby ซึ่ง ให้ศึกษาวิธีการเขียนภาษา Ruby ซึ่ง ก็แบ่งไห้คน ไปทำแตกต่างกัน ดังนี้

Jedsadakorn ให้ไปทำ อะไรก็ได้ โดยใช้ ภาษา ruby

Phutthinan ให้ไปทำ

Create functions (for array of objects) to - Find student BMI - Find/count number of students with BMI > 25 - Display student records with BMI > 25

Nutthagrit ให้ไปทำ

- Find minimum weight of students - Find/count number of students with weight < 50 - Display student records with weight < 50

และ

sarik ช่วย ทั้ง กลุ่ม 1 และ 2 รวมทั้ง ศึกษา ภาษาruby และ ช่วยกลุ่ม1 ออกแบบเกม



AS 2 : ทำไมเลือกภาษา ruby ?

  • สามารถพัฒนาความสามารถ และนำไปสร้างโปรแกรมต่างๆได้
  • มีรูปแบบการเขียนค่อนข้างง่าย
  • โปรแกรม RPG MAKER สามารถใช้ ruby สร้างคำสั่งได้
  • เป็นภาษาที่ยังไม่เคยศึกษามาก่อน
  • Free

โหลด ได้ที่

http://rubyinstaller.org/downloads/


ศึกษา การใช้งานได้ที่


กด 1
กด 2
กด 3


AS 2 : จะทำอะไร?


ทำ เกม-สื่อการเรียนรู้ ภาษา Ruby ขั้นพื้นฐาน 
โดยใช้ โปรแกรม RPG MAKER มาช่วย

03.png

04

เป้าหมาย และรูปแบบ


  • สอน - อธิบาย วิธีการเขียนโปรแกรม ภาษา Ruby ขั้น Basic
  • เป็นเกม RPG
  • เป็นDemo ก่อน
  • มีการสอน เรื่องคุณความดี การทำความดี มารยาท
  • อื่นๆ

  • อยากให้เป็น แรงบรรดาลใจ โดย เน้น เด็ก ๆ ให้ อยากศึกษา การเขียนโปรแกรม ให้ รู้ว่าการเขียนโปรแกรม ก็ไม่ได้ยากอย่างที่คิด โดยใช้เกม เป็นตัวกลาง