This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
// for example we'll evaluate string contains 8 characters | |
// change it if you want to evaluate longer string | |
int MAXSIZE = 8; | |
char stack[8]; | |
int top = -1; | |
/* Check if the stack is empty */ | |
int isempty(){ | |
if(top == -1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ClassA{ | |
public int x = 20; | |
public void show(){ | |
System.out.println("Hello from ClassA"); | |
} | |
public static void main(String args[]){ | |
ClassB cb = new ClassB(); | |
System.out.println(cb.x); //2. Apa output yang didapatkan dari baris ini |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//contoh kode program berikut memuat implementasi konsep inheritance / pewarisan | |
#include <iostream> | |
using namespace std; | |
class ClassA | |
{ | |
public: | |
int x = 20; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun main(args: Array<String>) { | |
val mahasiswa = Mahasiswa("M0501001", "Danzo Karto", "Uhuygakure") | |
mahasiswa.showMahasiswa() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Mahasiswa(val nim: String, val nama: String, val alamat: String) { | |
fun showMahasiswa(){ | |
println("nim: "+nim) | |
println("nama: "+nama) | |
println("alamat: "+alamat) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun main(args: Array<String>) { | |
val mahasiswa = Mahasiswa() | |
mahasiswa.showMahasiswa() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Mahasiswa { | |
var nim: String = "M0501001" | |
var nama: String = "Uzumaki Saburo" | |
var alamat: String = "Konohagakure" | |
fun showMahasiswa(){ | |
println("nim: "+nim) | |
println("nama: "+nama) | |
println("alamat: "+alamat) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
Remake Game Pong | |
pong-0 | |
"The Day-0 Update" | |
-- Program Utama -- | |
Penulis kode : Colton Ogden | |
cogden@cs50.harvard.edu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
Remake Game Pong | |
pong-0 | |
"The Day-0 Update" | |
-- Program Utama -- | |
Penulis kode : Colton Ogden | |
cogden@cs50.harvard.edu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- push is a simple resolution-handling library that allows you to focus on making your game with a fixed resolution. | |
-- https://github.com/Ulydev/push/ | |
-- push.lua v0.3 | |
-- Copyright (c) 2018 Ulysse Ramage | |
-- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
-- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HO |
NewerOlder