Skip to content

Instantly share code, notes, and snippets.

View JonasEmre's full-sized avatar
🕴️
Trying to figure out how life supposed to be.

Yunus Emre Toktaş JonasEmre

🕴️
Trying to figure out how life supposed to be.
  • Ankara, Turkey
View GitHub Profile
# Default ignored files
/shelf/
/workspace.xml
# Default ignored files
/shelf/
/workspace.xml
# Default ignored files
/shelf/
/workspace.xml
# Default ignored files
/shelf/
/workspace.xml
@JonasEmre
JonasEmre / TextBasedGame Eskiz
Created May 18, 2018 14:56
TextBasedGame Eskiz
namespace MainModule
{
class Program
{
public static void Main(string[] args)
{
bool run = true;
while (run == true)
{
Orcs orc = new Orcs();
@JonasEmre
JonasEmre / Zar Çeşitleri
Created May 12, 2018 21:45
Zar Çeşitleri
class Zarlar
{
// Zar atma metodları
public int birdAltı()
{
Random zarJenerator = new Random();
int zar1 = zarJenerator.Next(1, 7);
return zar1;
}
public int ikidAltı()
@JonasEmre
JonasEmre / Random Goblin ve Orc Generator
Created May 12, 2018 21:42
Random Goblin ve Orc Generator
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Inheritance
{
class Program
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Methods___Metodlar
{
class Program
{
# Bir Pygame oyunu yapmak için başlangıç teması veya iskeleti bu şekilde
import pygame
import random
# Önceden renk kodlarını verebilirsin istersen yardımcı olur
white = (255,255,255)
black = (0,0,0)
red = (255,0,0)
green = (0,255,0)
@JonasEmre
JonasEmre / Dosya okuma .read .readlines .readline
Created May 6, 2018 13:25
Dosya Okuma Metodları ve Kipler
# Bir dizin içerisinde dosya açma işlemleri
# Türkçe ve genel karakterler girmek istiyorsan UTF-8 olayını aynı böyle encoding etmen lazım.
file = open ("Bilgiler.txt","w",encoding="utf-8") # Sonuna "w" koyarsan Write komutu veriyorsun. Yani varsa dosya üstüne yazar yoksa yeni dosya yazar.
file.write("Eğer UTF-8 Kodu çalışıyor ise bu text dosyasında bu yazdıklarım gözükebilecektir.")
file.close()
file = open("Bilgiler.txt","a",encoding="utf-8") # W yerina A kipi kullanırsan o dosyaya append yapar girdileri varolan olaya ekler
file.write("\nBu yazdığım kısım ise append kipi ile yeni eklemiş olduğum satır olması lazım...")
file.close()