if(kakao)2021 – 고민보다?Code Game

if(kakao)2021 이벤트
고민보다👉 Code Game을 빛내준 센스 있는 코드를 공개합니다.

– 참여해 주신 많은 코드들 중 일부만 선별하여 공개합니다.


 

슬기로운 일상생활

 

본격적인 with covid19의 시작, 집콕하던 일상에서 다시 슬기롭고 안전하게 세상으로 나아가기 위해 우리는 어떤 준비를 해야 할까요? 더 슬기로운 위드 코로나 생활을 위한 나의 일상 모습을 코드로 표현해 주세요.

"if(me.includes(""마스크"" && ""손소독제"")){
    go(outside);
}else{
    go(home);
}

//bit.ly/jh-me"
"def 코인노래방( ):
   백신 = input(“백신 접종하셨나요?”)
   if 백신 == “1차 접종” :
               print(“2차 접종하고 오세요”)
   elif 백신 == “2차 접종”:
               day = int(input(“백신 접종 후 몇일이 지나셨나요?”)
                           if day ⟩= 14:
                                         print(“입장하세요”)
                           else:
                                        day-=14
                                        print(day, “일 후에 오세요”)
   else:
              print(“접종 후 오세요”)

백신으로 차별두지 않겠다는 정부 하지만, 제한이 너무 많아졌네요. 
하루빨리 모두가 안전한 백신맞고 마스크 벗을 날이 오면 좋겠습니다!"
"SELECT DAILY_LIFE
FROM MY_TIMES
WHERE COVID19_YN IS NULL
ORDER BY HAPPINESS_EXPONENT DESC"
"[root@World ~]# whereis covid
covid: 'Everywhere'

[root@World ~]# rm -f covid
rm: cannot completely remove 'covid': It's impossible for now

[root@World ~]# restore ""life_before_covid.dump""
Error while restoring life: We can't go back to the past

[people@World ~]# source ""wear_mask.sh""
[people@World ~]# source ""wash_hands.sh""
[people@World ~]# source ""if_sick_go_hospital.sh""

[root@World ~]# systemctl status people.service
""Will be OK!"""
"switch ( 백신 ) {
    case '접종후 14일이 경과되었습니다.':
        return (""출근 하세요"")
    default:
        return (""어서 출근 하세요 "")
}"
"while(true) {
    달고나커피젓기();
    // 이봐 break 따위는 존재하지 않아. 얼른 젓지 못해?
}"
"void main()
{
    int deadline = 100;
    bool wake = false;
    for(int day = 0: day < deadline; day++)
    {
        if(wake)
        {
            wake = false;
            wash()
            if(late)
            {
                callKakaotaxi()
            }
            else
            {
               rideBus() 
            }

            while(1)
            (
                codingwarrior()
                if(closingoffice)
                {
                    break;
                }
            )
        }

        Sleep()
    }
}"
"// 날도 추운데 집콕하면서, 맛난 음식을 잔뜩 먹어요!!!!
// 아! 이불 속에 들어가면 끝입니다. 
// 못나가요. 영.원.히.

int hp = 0;
// 나갈 수 있는 체력!
int i_can_go_out = 100;

while(hp<i_can_go_out){
    // 먹는다. 맛난 것. + 10 (띠롱)
    get_food(hp);

    // 코코 잔다. + 30 (띠롱)
    get_sleep(hp);

    break 엄마등짝스매싱;

};

get_food(int hp){
    return hp+=10;
}

get_sleep(int hp){
    hp += 30;

    // 아근데 이불속 너무좋아......
    while(1){
        break 엄마샤우팅;
    }
    // 눕는다 여기..... O⟨-⟨

    return hp;
}"
"        Life myLife = new Life( Nationality.REPUBLIC_OF_KOREA‚ Gender.MALE );
        Situation withCorona = (mask‚ vaccine‚ isSocialDistance) -> {
                Map<Action‚ Routine> practice = new HashMap<>();
                practice.add(Action.PUT_ON‚ mask);
                practice.add(Action.INJECTION‚ vaccine); // 1st
                practice.add(Action.INJECTION‚ vaccine); // 2nd
                practice.add(Action.SOCIAL_DISTANCE‚ isSocialDistance);
                return practice;
        };
Future future = myLife.suckItUp(withCorona(Mask.KF94‚ Vaccine.AZ‚ true));
System.out.println(future.getMind()); // ---> ""so happy"""
"백신_count = 0
day = 0
출근_flag = 0
tired_point = 0
pay = 0
while day < 31:
if 출근_flag == 0 and 백신_count < 3: my_state = '재택근무' tired_point += 0.5 pay += 1 day += 1 출근_flag = 1
elif 출근_flag == 0 and 백신_count > 1: my_state = '출근' tired_point += 1 pay += 1 day += 1 출근_flag = 1
elif 출근_flag == 1: my_state = '퇴근' tired_point -= 0.1 출근_flag = 0
elif day % 10 == 0: 백신_count += 1 print(tired_point) print(pay) 가설 : tired_point가 높을수록 pay가 높아진다. 선형회귀분석 accuracy : 0.9999 그래도 행복합"
"function canWeGetTogether {
	return isFullyVaccinated;
}
"
"const withCovid19 = {
must : ['손소독제'‚ '마스크'‚ '백신접종']‚ goal: ""일상회복"" }
let we = { me : []‚ you : [] }
for(let person in we) {
	for(let item of withCovid19.must) {
		we[person].push(item)
	}
	console.log(`${person} : ${we[person]}`)
}
console.log(`With Covid19‚ ${withCovid19.goal}!!`)"
if (date > today) and (covid is null):  return future=happy
"#include 
#include ⟨new_normal_new_hope.h⟩ void main(){
	printf(""Hello‚ new world!\n"");
	return 0;
}"
SELECT me.without_mask FROM my_life
WHERE date_id BETWEEN '2020-02-01' AND '2021-11-16'
ORDER BY date_id; ---------------------------------- 쿼리 결과 0개를 찾았습니다.

 

푸른 하늘 대작전

 

지구온난화로 인한 폭염과 폭우, 폭설. 그리고 지구 곳곳에서 일어나는 이상 기후 현상들까지. 우리는 기후 변화에 대응하고 푸른 하늘을 되찾기 위해 어떤 노력을 해야 할까요?
미래 대책 방안을 코드로 표현해 주세요.

.sky {
  background-color : #0000FF
}
"// 생활 속 전기절약
if(가전제품.state == 대기전력사용) {
        플러그뽑기();
}
if((TV.state == ON) && (My.state != TV시청)){
        turnOff(TV);
}
if(heater.temperature ⟩ 23){
        setTemperature(23);
}

void 방에서_나가기(){
        turnOff(computer);
        turnOff(light);
        // TODO 방에서 나갈때 하는 행동들
}"
"
  def save_the_sea():
   join('#team_seas')
   have('interest in the_sea')
   
def develop_transportation():
   use_electric_car()
   buy('Tesla!')

def carbon_neutrality():
   like('ESG_Company')
   recude('waste')

save_the_sea()
develop_transportation()
carbon_neutrality()"
System.gc()
"function 출근(){
    coffee(""takeout"");
    commuting(""subway"");
}

function coffee(type){
    return type == ""takeout"" ? ""tumbler"" : ""mugcup"";
}

function commuting(type){
    
    switch (type) {
    case ""subway"":
        console.log(""대중교통"");
        break;
    case ""bus"":
        console.log(""대중교통"");
        break;
    case ""bicycle"":
        console.log(""자전거"");
        break;
    default:
        console.log(""대중교통을 이용합시다"");
        break;
    }
}"
"class coffee:
  type = None
  is_takeout=None
  tumblr=None
  def __init__(self, type='americano' takeout=false, tumblr=None):
    self.type = type
    self.is_takeout =takeout
    self.tumblr=tumblr

  def get_coffee():
    if is_takeout :
      if tumblr is None:
        raise WastedPlasticException
      else:
        print('Blue Sky!')
    return self"
"if ESG.score >= 'S':
    give_present()"
"Earth earth = new Earth();
Person me = new Person();

while(true){
    earth.health -= 3;
    if(me.recycling) earth.health += 1;
    if(me.useTransportation) earth.health += 1;
    if(me.saveElectronic) earth.health += 1;

    if(me.studyHard() && me.workWithOthers()){
        createUsefulApp();
        earth.health += 100;
    }
}"
"data = getBadWeatherfromBC()
model = torch.load('GTP-3_forWeather.pth')
optimizer = AdamP(params = model.parameter(), )
loss = nn.CrossEntropyLoss()
kfold = StratifiedKFold(n_splits=100, shuffle=True)
for fold_idx, (train_ids, valid_idx) in enumerate(kfold.split(data.X, data.y)):
  isGreat = False
  while not isGreat:
    previous_BEST_ACC[fold_idx-1] = 0
    for epoch in range(1, epoch_tot+1):
      model.zero_grad()
      for phase in ['train', 'valid']:
        if phase == 'train' : model.train()
        else : model.eval()
        for step, (train_X, train_y) in enumerate(dataloaders[phase]):
            optimizer.zero_grad()
            with torch.set_grad_enable(phase=='train'):
              ouputs = model(train_X)
              prediction = doActivation(outpus)
              step_pd = preds.data.cpu().numpy()
              step_gt = train_y.data.cpu().numpy()
              loss = lss_class(outputs, train_y)
              if phase == 'train':
                loss.backward()
                optimizer.step()
            step_loss = loss.item()
            epoch_loss = step_loss*len(train_y])
            step_pd.append(prediction)
            step_gt.append(train_y)
        if phase =='valid:
          best_Valid_ACC = metric(step_pd, step_gt)['ACC']
          previous_BEST_ACC[fold_idx-1] <= best_Valid_ACC:
          best_wts = copy.deepcoy(model.state_dict())
    if epoch == epoch_tot 
      if previous_BEST_ACC[fold_idx-1] >99.:
        isGreat = True
        torch.save('model_state_dict':best_wts, p)
      break"
"while (false) {
  포기하기();
}"
"while(1) {
	runCarbonCaptureAndStorage();
	plantingTrees();
	useEcoFriendlyMaterials();
	loveYourNeighbor();
}
"
find /earth/tresh/* -type f -exec rm {} \;
const makeNewEarth = () =>{ console.log("새로운 지구 생성"); } makeNewEarth();
while(IsClearBlueSky()) { DoSomethingForEnvironments(); }
"class EarthSaver(tanos : Tanos) {
        fun saveEarth() : BigDecimal{
                var humanNum =  tanos.fingerSnap()  return humanNum
        }
}"
"#하루 사용 가능 일회용품 개수 정해놓고 사용하기 // 일일 사용가능 일회용품
var dayCnt = 5;
function blueSkyOpr(thing) {
if(thing.type == ""일회용""){
if(dayCnt >= 1){
print(""일회용품 사용을 줄여주세요 오늘 하루 남은 사용 횟수 : "" + dayCnt);  dayCnt--;  return true;
}
else{
print(""금일 사용 가능한 일회용품 횟수를 초과하셨습니다 !"");
return false;
}
}else if(thing.type != ""일회용""){
print(""일회용품이 아니네요 바람직합니다 ! "");  }
}"
def go_space(): users=get_users() take_space_x(user).goto_mars()

 

내맘대로 여행패스

 

열려라 하늘길! 다시 걷는 대한민국!
서울 대전 대구 부산 제주 찍고! 대한민국 방방곡곡 어디까지 가봤니? 지금 당장 마음 놓고 떠날 수 있다면 첫 여행지는 어디가 좋을까요? 모두를 위한 추천 여행 코스를 코드로 표현해 주세요.

"const MBTITravel = (MBTI) =⟩ {
  if (MBTI.charAt(0)==='I') {
    stayHome();
    watchKakaoWebtoon();
    watchKakoTV();
    return;
  } else {
    if (MBTI.charAt(3) === 'J') {
      useKakaoMap();
      useKakaoTaxi();
      if (MBTI.charAt(1) === 'N') {
        return ChunCheon;
      } else {
        return Seoul;
      }
    } else {
      return Jeju;
    }
  }
};"
"import webbrowser

url = ""https://www.youtube.com""
webbrowser.open(url)

# 누워서 방방곡곡 여행 가능"
"function trip() {
    const recommend = max(count_sns_place_hashtag( ))
    return recommend
}"
"input(""어디로 가시겠습니까?"")

>>> my bed"
"while not satisfy:
    arrival = random.choice(Bucket list)
    go_and_eat(arrival)
    if 통장 is empty:
        break"
"SELECT A.VISITCITY AS 가야 할 한국의 도시
FROM KOREACITY A
LEFT OUTER JOIN MYVACTION B ON A.KOREA_CITY = B.VISITCITY 
WHERE B.VISIT_GBN <> 'Y'
  AND A.VISITCITY IS NOT NULL"
"
int main()
{

    printf(""우리 제주로 떠나보는거 어때요~?\n"");
    printf(""#제주 #인기관광지 #추천 #제주관광공사 분석\n"");
    printf(""----------------------------------------------------------------------------\n"");
    printf(""\n"");
    printf(""테마를 선택해 주세요!(숫자 입력)\n"");
    printf(""1. 친구 | 2. 휴식과 치유 | 3. 레저와 체험\n"");
    scanf(""%d"", &a);

    int a = 0;
    switch (a) {
        case 1:
            printf(""<친구>테마를 선택하셨군요:)\n"");
                printf(""1위 : 쇠소깍\n"");
                printf(""2위 : 함덕해수욕장\n"");
                printf(""3위 : 주상절리대\n"");
                printf(""4위 : 용두암\n"");
                printf(""5위 : 협재해수욕장\n"");
            break;
        case 2:
            printf(""<휴식과 치유>테마를 선택하셨군요:)\n"");
                printf(""1위 : 성산일출봉\n"");
                printf(""2위 : 천지연폭포\n"");
                printf(""3위 : 사려니숲\n"");
                printf(""4위 : 카멜리아힐\n"");
                printf(""5위 : 새별오름\n"");
            break;
        case 3:
            printf(""<레저와 체험>테마를 선택하셨군요:)\n"");
                printf(""1위 : 981파크\n"");
                printf(""2위 : 윈드1947카트테마파크\n"");
                printf(""3위 : 제주레일바이크\n"");
                printf(""4위 : 렛츠런파크제주\n"");
                printf(""5위 : 제주민속촌\n"");
            break;
    }

    return 0;
}"
"# Python3

def show_travel_course():
    places = {""속초"":[""속초 해수욕장"", ""아바이 마을"", ""설악 케이블카"", ""닭강정 먹기""],
              ""양양"":[""낙산사"", ""양리단길"", ""레포밸리"", ""하조대""],
              ""강릉"":[""경포대"", ""오죽헌"", ""강문 해변"", ""정동진"", ""☕ 11월 커피 축제""],
              ""동해"":[""망상 해수욕장"", ""묵호항"", ""촛대 바위"", ""천곡 동굴"", ""추암 조각공원""],
              ""삼척"":[""해신당 공원"", ""환선굴"", ""레일 바이크"", ""쏠비치""]}

    print(""동해안, 여름에만 즐기시나요?"")
    print(""[ 더 춥기 전에 즐기는 겨울 동해안 ]"")
    
    for location in places:
        print(f""({location}) : "", end = '')
        print(*places[location], sep = "" - "")

    print(""동해안에서 좋은 추억 만들고 가세요!"")

show_travel_course()"
"fun findTheBestTrip(): Place {
	val places = getAllPointOfInterestsOfKorea()
		val candidates = places.filter{
			!it.visited()
		} // 방문한적이 없고 .
	filter{
		!it.hasBadMemory()
	} // 나쁜 기억도 없고
	.filter{
		!it.hasLowScore()
	} // 별점이 나쁘지도 않고
	.filter{
		it.isMyTaste()
	} // 내 취향이고
	.filter{
		!it.manyCoronaInfected()
	} // 코로나 환자 발생이 많지도 않으면
	return candidates[Random.getInt(candidates.size())] // 어디든 좋아요
}"
while(covid19State()){  startMetaverse(); } //... startMetaverse();
"# 기대했던 8박9일 신혼여행
Honeymooon=[[]
for _ in range(9)] Love_it=[가우디 투어‚ 스페인 맛있는 음식‚ 스페인 특산품 쇼핑‚ 스페인 추억 사진찍기]
Day = 0 COVID_19 = a_lot_of_virus
for something in Love_it Honeymooon[Day].append(something) Day += 1 COVID_19 -= Efforts to reduce COVID_19 while True:
if Covid_19 == 0:
print(Honeymooon)
        else:
        print('조금만 기다려보자ㅠㅠ')"
location.href="https://search.daum.net/search?nil_suggest=btn&w=tot&DA=SBC&q=국내여행"
"package kakko;
import java.util.Scanner;
public class Travel {
	public static void main(String[] args) {
		Scanner input=new Scanner(System.in);
		int num=0;
		System.out.print(""숫자 입력"");
		num=input.nextInt();
		if(num==1) { System.out.println(""1.부산 광안리"");
		}
		else if(num==2) {
			System.out.println(""2.여수 엑스포"");
		}
		else if(num==3) {
			System.out.println(""3.담양 죽녹원 대나무숲"");
		}
		else if(num==4) {
			System.out.println(""4.서울 경복궁"");
		}
		else if(num==5) {
			System.out.println(""5.서울 롯데타워"");
		}
		else if(num==6){
			System.out.println(""6.전주 한옥마을"");
		}
		else if(num==7){
			System.out.println(""7.광주 무등산"");
		}
		else {
			System.out.println(""8.제주도 아무곳이나"");
		}
	}
}"
"_world = [ europe‚ north america‚ south america‚ antarctica‚ africa‚ asia‚ oceania ]
while money ⟩0: goTravel(random.choice(_world))"
if possible = anywhere in korea where = not important who = important but single= real {[it is ok!]……really?}

 

 

카카오톡 공유 보내기 버튼

Latest Posts

제5회 Kakao Tech Meet에 초대합니다!

Kakao Tech Meet #5 트렌드와 경험 및 노하우를 자주, 지속적으로 공유하며 개발자 여러분과 함께 성장을 도모하고 긴밀한 네트워크를 형성하고자 합니다.  다섯 번째

테크밋 다시 달릴 준비!

(TMI: 이 글의 썸네일 이미지는 ChatGPT와 DALL・E로 제작했습니다. 🙂) 안녕하세요, Kakao Tech Meet(이하 테크밋)을 함께 만들어가는 슈크림입니다. 작년 5월에 테크밋을 처음 시작하고,